note 16346 deleted from function.setcookie by imajes
| From: | imajes@php.net | Date: | Wed, 30 Jan 2002 05:41:57 +0000 |
| Subject: | note 16346 deleted from function.setcookie by imajes | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-26006@lists.php.net to get a copy of this message | ||
Two things. First the small one -- how to delete all your site's cookies:
if (0<sizeof($HTTP_COOKIE_VARS))
{while (list ($k_cookie, $v_cookie) = each ($HTTP_COOKIE_VARS))
{ setcookie($k_cookie);
}
}
Second, how to set a cookie for MSIE (Internet Explorer):
function ms_cookie_time($i_time)
{ return date("l, d-M-Y h:i:s T",$i_time);
}
setcookie($sz_cookie_name,$v_value,ms_cookie_time((time())),'/','.yourdomain.com');
Netscape will accept UNIX timestamp (the number of seconds since January 1 1970 00:00:00 GMT), but
MSIE will not.
Bon appetit!