note 17183 modified in function.setcookie by john
| From: | john@php.net | Date: | Thu, 28 Nov 2002 02:22:18 +0000 |
| Subject: | note 17183 modified in function.setcookie by john | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40052@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
--was--
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