note 3842 modified in function.setcookie by sander
| From: | sander@php.net | Date: | Wed, 05 Dec 2001 11:55:39 +0000 |
| Subject: | note 3842 modified in function.setcookie by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21630@lists.php.net to get a copy of this message | ||
I just realized that if you set a cookie, and you want to unset the cookie you will have to follow
the order on the setcookie();
for example:
<pre>
setcookie("MyCookie","MyCookieValue",time()+3600,"/tmp","www.domain.com");
then for unsetting the cookie:
setcookie("MyCookie","","","/tmp","www.domain.com");
</pre>
On the previous note about unsetting cookie, if you have double quotes on the time parameter, you
have to the quotes on the unset cookie.
Thanks
- Rudy
--was--
I just realized that if you set a cookie, and you want to unset the cookie you will have to follow
the order on the setcookie();
for example:
<pre>
setcookie("MyCookie","MyCookieValue","time()+3600","/tmp","www.domain.com");
then for unsetting the cookie:
setcookie("MyCookie","","","/tmp","www.domain.com");
</pre>
On the previous note about unsetting cookie, if you have double quotes on the time parameter, you
have to the quotes on the unset cookie.
Thanks
- Rudy
http://www.php.net/manual/en/function.setcookie.php