Forum Moderators: phranque

Message Too Old, No Replies

set cookie in a way that it can be read by other sites

         

zoom123

12:16 am on Nov 19, 2006 (gmt 0)

10+ Year Member



Hi,
how can i set a cookie, so that it can be read by any site on the net?
(i really want the cookie to be readable!)

greetz,
zoom123

stajer

1:31 am on Nov 19, 2006 (gmt 0)

10+ Year Member



Can't be done. Cookies are purposely set so they can't be read by other domains - security and privacy reasons.

If you run the network of sites, you can code your outgoing links to run a script on the next site to set a new cookie with the info of the old cookie. but you would need to do it everytime a user jumps to a new site.

zoom123

12:17 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



if i want to i can publish the cookie data on a webpage, so there should not be any security issues.

so is there absolutely no way to do this?

jtara

5:20 pm on Nov 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing in a cookie that says who it is "for".

Controlling whether cookies are sent to a given website is entirely a function of the user's web browser.

When the browser receives the cookie, it stores it locally. When it is stored, it is associated with the domain name that sent the cookie. When the browser contacts the same domain again, it sends any cookies stored under that domain name.

Sites don't "read" cookies. Browsers fling them at the browser. The server can choose to catch the cookie or not. Servers don't have the ability to reach into your cookie jar.

I know of no browser that will send a cookie to a site other than the one that set it. That would be insane. Nobody would have any money in their online bank accounts, and Nigeria would be the world's wealthiest nation.

rocknbil

10:21 pm on Nov 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Zoom maybe you can tell us what task you want to accomplish and we can suggest what other methods you can try.

The bottom line is that a cookie can only be read on the domain which it's set, and This Is A Good Thing.