note 109173 added to function.setcookie
| From: | Bachsau | Date: | Tue, 26 Jun 2012 01:49:05 +0000 |
| Subject: | note 109173 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188795@lists.php.net to get a copy of this message | ||
Want to remove a cookie?
Many people do it the complicated way:
setcookie('name', 'content', time()-3600);
But why do you make it so complicated and risk it not working, when the client's time is wrong?
Why fiddle around with time();
Here's the easiest way to unset a cookie:
setcookie('name', 'content', 1);
Thats it.
----
Server IP: 158.255.214.58
Probable Submitter: 94.219.254.81
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/109173
Del: integrated -- https://master.php.net/note/delete/109173/integrated
Del: useless -- https://master.php.net/note/delete/109173/useless
Del: bad code -- https://master.php.net/note/delete/109173/bad+code
Del: spam -- https://master.php.net/note/delete/109173/spam
Del: non-english -- https://master.php.net/note/delete/109173/non-english
Del: in docs -- https://master.php.net/note/delete/109173/in+docs
Del: other reasons-- https://master.php.net/note/delete/109173
Reject -- https://master.php.net/note/reject/109173
Search -- https://master.php.net/manage/user-notes.php