Creating a Javascript re-direct cookie

I need to create a cookie to re-direct the user under certain
conditions.

  1. The user visits a page ~ a cookie a cookie is created with an
    expire time of one 1 day (or number of hours)

  2. Later in the site function a success page is visited ~ the
    browser checks the the presence of this cookie

  3. If the cookie is present the browser re-directs to the
    appropriate page, otherwise displays the existing content. (Anyone
    visiting the success page from pages without the cookie has the
    original content displayed.)

Can anyone point me to the appropriate learning resources? or give
some pointers?

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Actually I don’t think this is going to be possible as the success page does not actually reside on the domain where to cookie is to be created.

A bit out of my depth here.

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

As long as the cookie and the script are on the same machine, there’s no trouble redirecting to another machine. You just set

window.location.href = 'http://example.com';

That’s all it takes.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walt,

No both sites are not on the same server. Can you use an iframe to read the cookie from the other site?

David

On 5 Dec 2010, at 23:44, waltd wrote:

As long as the cookie and the script are on the same machine, there’s no trouble redirecting to another machine. You just set

window.location.href = 'http://example.com';

That’s all it takes.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No. If you want to get into cross-domain requests, you’re going to
have to use something other than cookies. You’re going to have to re-
architect your system to have the remote server set a variable in the
querystring or something like that.

Could you please spell out the use-case more completely? What is on
the remote server? Do you control both servers?

Walter

On Dec 6, 2010, at 4:45 AM, David Owen wrote:

Thanks Walt,

No both sites are not on the same server. Can you use an iframe to
read the cookie from the other site?

David

On 5 Dec 2010, at 23:44, waltd wrote:

As long as the cookie and the script are on the same machine,
there’s no trouble redirecting to another machine. You just set

window.location.href = 'http://example.com';

That’s all it takes.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walt,

Basically a PayPal success page needs to reflect the branding depending on which shopping cart an order was processed on.

Shop A > logo A > Cart A
Paypal > Success page (displaying either A or B)
Shop B > logo B > Cart B

Both shopping carts are different ‘external’ carts. So cookie (or method) have to survive the cart process. My first thought was cookies but the shops are on different boxes and different domains, shared hosting.

David

On 6 Dec 2010, at 13:55, Walter Lee Davis wrote:

No. If you want to get into cross-domain requests, you’re going to have to use something other than cookies. You’re going to have to re-architect your system to have the remote server set a variable in the querystring or something like that.

Could you please spell out the use-case more completely? What is on the remote server? Do you control both servers?

Walter

On Dec 6, 2010, at 4:45 AM, David Owen wrote:

Thanks Walt,

No both sites are not on the same server. Can you use an iframe to read the cookie from the other site?

David

On 5 Dec 2010, at 23:44, waltd wrote:

As long as the cookie and the script are on the same machine, there’s no trouble redirecting to another machine. You just set

window.location.href = 'http://example.com';

That’s all it takes.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi David,
You can supply PayPal (both x-click and the cart) return addresses for successful and aborted purchases in your buy form. For example;

<input type="hidden" name="return" value="http://www.freewayactions.com/product.php?id=002">
<input type="hidden" name="cancel_return" value="http://www.freewayactions.com/product.php?id=002">

For more information take a look at page 339 of PayPal’s integration guide PDF;
https://www.paypalobjects.com/WEBSCR-640-20101108-1/en_US/pdf/PP_WebsitePaymentsStandard_IntegrationGuide.pdf

This way Shop A can redirect back to a Shop A success page and the Shop B can do the same with a Shop B success page. Make sure the Auto Return option is on (page 271 of that guide) so you get to see all of the users passing through the stores.
Regards,
Tim.

On 6 Dec 2010, at 14:25, David Owen wrote:

Basically a PayPal success page needs to reflect the branding depending on which shopping cart an order was processed on.

Shop A > logo A > Cart A
Paypal > Success page (displaying either A or B)
Shop B > logo B > Cart B

Both shopping carts are different ‘external’ carts. So cookie (or method) have to survive the cart process. My first thought was cookies but the shops are on different boxes and different domains, shared hosting.

FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Tim,

Do these fields survive an external cart? for example one of the carts is using Mal’s

David

On 6 Dec 2010, at 14:40, Tim Plumb wrote:

Hi David,
You can supply PayPal (both x-click and the cart) return addresses for successful and aborted purchases in your buy form. For example;

<input type="hidden" name="return" value="http://www.freewayactions.com/product.php?id=002">
<input type="hidden" name="cancel_return" value="http://www.freewayactions.com/product.php?id=002">

For more information take a look at page 339 of PayPal’s integration guide PDF;
https://www.paypalobjects.com/WEBSCR-640-20101108-1/en_US/pdf/PP_WebsitePaymentsStandard_IntegrationGuide.pdf

This way Shop A can redirect back to a Shop A success page and the Shop B can do the same with a Shop B success page. Make sure the Auto Return option is on (page 271 of that guide) so you get to see all of the users passing through the stores.
Regards,
Tim.

On 6 Dec 2010, at 14:25, David Owen wrote:

Basically a PayPal success page needs to reflect the branding depending on which shopping cart an order was processed on.

Shop A > logo A > Cart A
Paypal > Success page (displaying either A or B)
Shop B > logo B > Cart B

Both shopping carts are different ‘external’ carts. So cookie (or method) have to survive the cart process. My first thought was cookies but the shops are on different boxes and different domains, shared hosting.

FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi David,
To be honest I don’t know but looking at the following page suggests that the return address feature should work through the PayPal checkout process;
http://www.mals-e.com/paypal.php

Set up a quick test and see if you can get the process to work for you.
Regards,
Tim.

On 6 Dec 2010, at 14:55, David Owen wrote:

Do these fields survive an external cart? for example one of the carts is using Mal’s

FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks, I’ll follow and research setting a success page, hopefully this will save a lot of messing around.

David

On 6 Dec 2010, at 15:03, Tim Plumb wrote:

Hi David,
To be honest I don’t know but looking at the following page suggests that the return address feature should work through the PayPal checkout process;
http://www.mals-e.com/paypal.php

Set up a quick test and see if you can get the process to work for you.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options