note 1988 deleted from setcookie by ronabop
| From: | ronabop@php.net | Date: | Sat, 09 Sep 2000 03:00:29 +0000 |
| Subject: | note 1988 deleted from setcookie by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4591@lists.php.net to get a copy of this message | ||
DELETING COOKIES
This might be obvious to someone that understands cookies, but that's not me, or probably other
users.
If you set a cookie with the domain paramter, in order to unset it, you need to call setcookie with
an empty value paramater, but with the same domain paramter. You _can't_ simply call setcookie
with one paramter, the cookie name, and delete the cookie (which is what the documentation says). It
won't be deleted if you supplied a domain paramater on setting the original cookie.
In truth, I'm not sure if this actually deletes the cookie, or just sets the value of the
cookie to the empty string, but for most php code this will amount to the same thing.