Page 1 of 1

browser is not accepting my sent cookie

Posted: Tue Jul 27, 2004 6:19 am
by jasongr
Hello

I have transfered my PHP application from my work station where I worked locally to a Linux Web server

For some reason, my code that sent cookies to the browser doesn't work anymore.
My call to setcookie works flawlessly (it returns true)... However when I look at the $_COOKIE array in the next time I reach the server, the cookie not there.

I even checked my local machine to see if a cookie file has been generated for me and NO!

what could cause the browser to stop accepting cookies?

I am using IE6


thanks

Posted: Tue Jul 27, 2004 9:24 am
by AGISB
Time can stop it.


Sounds weird but there is a bug in IE that does not accept cookies that are send when the client machine has the wrong time.

Lets say you send a cookie to last for 5 minutes and the client machine time is 6 minutes ahead of the server time it is not accepted as the client machine interprets it as expired.


Rasmus Lerdorf himself has a tip to avoid this: Use an indefinate cookie and set a value timestamp and check it and decide to accpet or deny the cookie.

Posted: Tue Jul 27, 2004 9:46 am
by jasongr
I managed to solve it

turns out that I didn supply the domain part in the setcookie function...
silly me