[SOLVED] browser is not accepting my sent cookie

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

browser is not accepting my sent cookie

Post 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
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post 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.
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

Post by jasongr »

I managed to solve it

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