Re: setcookie BUG w/ IE 5.5, 6.0 & Netscape!
| From: | Richard Lynch | Date: | Tue, 04 Dec 2001 21:21:41 +0000 |
| Subject: | Re: setcookie BUG w/ IE 5.5, 6.0 & Netscape! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76592@lists.php.net to get a copy of this message | ||
Kris Wilkinson wrote:
> Just recently I've noticed an issue with setcookie. My scripts which
> normall ran :
>
> setcookie ("myCookie","Blah","time()+7201");
>
> Are killing the cookie immediately after you close the browser window, or
> access another https:// site. It appears as though the life of
> the cookie
> is actually not being set, and is based entirely around the life of the
> browser window which it was originally called.
>
> if you leave the window open, and attempt at access the cookie from
> another window, the cookie does not exist.
>
> IDEAS? PHP GODS? :)
1. You have to take the quotes off the time stuff, so it turns into a
number, not a meaningless string.
2. IE is broken because MS engineers can't read the Netscape cookie spec to
save their lives, so if you specifiy a time, you must specify a path , '/'
as well. (*SOME* versions of IE work, some don't).
Right now, your time argument is simply turning into 0, because you are
using a string where it should be a number, and 0 means "session cookie"
which means it dies with the browser quitting.
The cookie *SHOULD* be there from another window of the same browser
version -- I dunno how you messed that up.
--
Like music? http://l-i-e.com/artists.htm