Re: re-setting all cookies
| From: | Burhan Khalid | Date: | Tue, 22 Mar 2005 10:56:35 +0000 |
| Subject: | Re: re-setting all cookies | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211279@lists.php.net to get a copy of this message | ||
Ken wrote:
/*From the php manual $arr = array(1, 2, 3, 4); foreach ($arr as &$value) { $value = $value * 2; } */ $_COOKIE is a variable... but you need the key for setcookie(). so you can do: foreach($_COOKIE as $key => $value){ setcookie("$key","", time()-3600); } i know there is the $value bit that we never use, but this is the simplest form I can think of. can anyone else think of something better?foreach(array_keys($_COOKIE) as $key) { setcookie($key,"",....