note 17183 added to function.setcookie

From: Date: Thu, 29 Nov 2001 01:20:59 +0000
Subject: note 17183 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-21397@lists.php.net to get a copy of this message
Cookies Won't Set on Some Clients? Check their System Clock! After much shaking of the head and stroking the virtual beard, I have discovered yet another cause for cookie failures: the system clock of the client. If the client's clock is wrong it can cause cookies to fail. I had a user for whom I simply could not set cookies. Finally I observed that all cookies with an expiration date were failing, while all cookies without an expiration date were succeeding. Note: incorrectly passing a string "time()+..." instead of the integer time()+... is the same as passing no expiration date. Armed with this clue I reexamined the user's email to me and observed that his system clock appeared to be set to the year 2009! So all my cookies would have already appeared to have expired. Chip -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+17183 http://master.php.net/manage/user-notes.php?action=delete+17183 http://master.php.net/manage/user-notes.php?action=reject+17183

« previous php.notes (#21397) next »