weird IE cookie problem
| From: | Javier Montserat | Date: | Mon, 14 Oct 2002 17:25:25 +0000 |
| Subject: | weird IE cookie problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-119924@lists.php.net to get a copy of this message | ||
Hi
I've successfully been using the following code to set cookies in IE / NS / Mozilla. I've just bought a new laptop and in IE 5.5 and 6 the cookies are not being set by my site. Other sites (msn etc) set cookies fine. I've installed Mozilla and this accepts cookies fine. WTF is wrong with IE on this new machine...???
Has anyone encountered anything like this...???
Here's the code -
$cookiename = "test";
$value = "testvalue";
$expires = time()+3600;
$domain = "mydomain.com";
$path = "/";
$COOKIE = "Set-Cookie: $cookiename=$value";
if (isset($expires) && ($expires > 0)) {
$COOKIE .= "; EXPIRES=".
gmdate("D, d M Y H:i:s",$expires) .
" GMT";}
if (isset($domain)) { $COOKIE .= "; DOMAIN=$domain"; }
if (isset($path)) { $COOKIE .= "; PATH=$path"; }
if (isset($secure) && $secure>0) { $COOKIE .= ";
SECURE"; }
header($COOKIE,false);
// this doesn't work either ...
setcookie ( $cookiename , $value, $expires, $path, $domain);
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com