If you want to delete all cookies on your domain, you may want to use the value of:

['HTTP_COOKIE'?>
rather than:



to dertermine the cookie names. 
If cookie names are in Array notation, eg: user[username] 
Then PHP will automatically create a corresponding array in $_COOKIE. Instead use $_SERVER['HTTP_COOKIE'] as it mirrors the actual HTTP Request header. 


// unset cookiesif (isset($_SERVER['HTTP_COOKIE'])) {
    
$cookies explode(';'$_SERVER['HTTP_COOKIE']);
    foreach(
$cookies as $cookie) {
        
$parts explode('='$cookie);
        
$name trim($parts[0]);
        
setcookie($name''time()-1000);
        
setcookie($name''time()-1000'/');
    }
}
?>