note 48621 deleted from function.setcookie by tularis
| From: | tularis@php.net | Date: | Sun, 02 Jan 2005 14:10:42 +0000 |
| Subject: | note 48621 deleted from function.setcookie by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82566@lists.php.net to get a copy of this message | ||
Note Submitter: enlightenment at scholieren dot com
----
I had great trouble deleting a cookie. I tried to use:
setcookie('SSID','blahblahblah',3600,'/');
setcookie('SSID',false);
This did not work, although debugging the headers show that PHP sent a "X-SET-COOKIE:
SSID=deleted" header, Firefox ignores this and resends the cookie after closing en restarting
the browser.
The correct way to destroy a cookie:
setcookie('SSID','blahblahblah',3600,'/');
setcookie('SSID',false,-3600,'/');
Thus set the expire time in the past and use the very same paramters as stated in the manual page
above. Except the value of course, it should be false (without ' ').