note 17183 deleted from function.setcookie by sniper

From: Date: Wed, 11 Dec 2002 07:19:28 +0000
Subject: note 17183 deleted from function.setcookie by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40739@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. [Editors Note: The above is misleading. PHP Treats strings and integers identically, "time()+..." is incorrect (since you are storing the *string* 'time()' instead of calling the PHP function)] 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

« previous php.notes (#40739) next »