On Fri, Sep 19, 2003 at 09:14:57PM -0400, Stevie D Peele wrote:
: 
: How can I clear all cookies that have been previously set?
: 
: I want this in an if statement so something like
: 
: if ($value == $blue){
: clear all cookies;
: setcookie("name",time()+3600);
: }

Walk through your $_COOKIE array and expire each one:

        if ($value == $blue)
        {
                foreach ($_COOKIE as $name => $value)
                {
                        setcookie($_COOKIE["$name"], "", time()-3600);
                }
        }

But I don't know what might happen if you use setcookie() to expire a
cookie and then use setcookie() later on to set the same cookie.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to