Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need cookie help (before I have a stroke!)

Status
Not open for further replies.

greedyzebra

Technical User
Sep 5, 2001
140
US
I'm creating two cookies on my web site. One is created on the index page (presumably the entry point, but the javascript function that does this is called "onload" on every page). The other is very specific and is created and added to based on user selections on another page.

On entry into the page where the user can manipulate the contents of the second cookie, I alert document.cookie. The data from the previously created cookie is there. When the user performs the actions to manipulate the cookie I alert document.cookie. All of the data is successfully added.

On exit from the page where the user can manipulate the contents of the second cookie I alert document.cookie. Everything is fine, the contents of both cookies is there.

However, when I get to the page that needs the data from the second cookie (usually the page accessed after exiting the page where the second cookie is manipulated) Only the first cookie appears. What happened to my second cookie? Where did it go? I do nothing on the page where it's missing to affect document.cookie. I don't set expiration dates or exclude the cookie to a particular domain. Even if I did the domain is not different.

Please help before I have a stroke or put my fist through the computer screen! :)

Thanks.
 
You'll have better luck if you post this in the javascript forum. Also, it'd be a good idea if to post your code, or a link to your pages. Makes it easier to figure out what's going on...

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top