Forum Moderators: open

Message Too Old, No Replies

Localhost cookies - Firefox/Opera auto-expire on browser close?

PHP cookies seem to work fine but not this JS set cookie?

         

JAB Creations

3:59 pm on Feb 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having a little trouble with a message that sets a cookie coming back EVERY time the browser is closed when I go back to test my site locally. Is there some known issue with localhost / domain associated via your host file where cookies (regardless of their length) are deleted when the browser is closed? I'm running the new version of my site locally on my computer at home.

Here is an example of my JS code for setting the cookie in question.

onmousedown="document.cookie='bandwidth=2;path=;time()+314496000;'"

Now this is the only one of three cookies that is set by JavaScript. So when I look for any cookies after closing the browser the cookies set by PHP still exist.

Any ideas?

John

DrDoc

6:44 pm on Feb 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Might be the absence of the path value ...?
... and the name, and domain?

No way for the browser to know which cookie to send back :)