views:

76

answers:

1

I'd like to keep some information on the client which element was clicked and thus save the information within a cookie, but it's a third party cookie because I need this information on antoher page (affiliate-tracking is the context) so I'd have to set it via http request as far as I see it. Javascript would only allow me to place a within the same domain - which will be left after the click.

Now I can send of the http-request via Javascript with the onbeforeunload event, but what happens to this http-request once the browser has left the page? Does it still "take the call" and places the cookie or does it ignore the call since the website from which the request originated is no more?

Could not find any documentation on this, so I'd be grateful if anyone had a clue.

Thanks, Benjamin

+1  A: 

If you close your browser (or click on a different link/page) after you have sent a Http request, the response from that Http Request will disappear into a black hole. Indeed, the web server may or may not actually send the full response depending on the size of the requested page and the point at which the requesting socket was closed.

Steve