note 70606 deleted from function.setcookie by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 17:56:43 +0000 |
| Subject: | note 70606 deleted from function.setcookie by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155041@lists.php.net to get a copy of this message | ||
Note Submitter: shitdeposit at hotmail dot com
----
An undocumented "feature" of setcookie:
Example:
setcookie( 'delete_me', '', time() - 1000, '/', '',
'' );
The setcookie function will silently change the '' cookie value to 'deleted' and
override your expiry time to time() - 1 year.
I only noticed this when the computer I was testing on had it's date set incorrectly to the
> 1 year in the past. The computer connects to the server which has it's date correctly set
and thus the cookie on the client doesn't delete but stores the value "deleted"
instead.