note 971 deleted from setcookie by ronabop

From: Date: Fri, 11 Aug 2000 15:37:26 +0000
Subject: note 971 deleted from setcookie by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-1193@lists.php.net to get a copy of this message
I'm running into the most frustrating problem and I'm amazed nobody has mentioned this before. The cookie, using Netscape 4.x won't set if the host is without the www. What I mean is that if I surf to the website with url: http://domain.com the cookie will not write to the drive. It will not set if I write it either way: <PRE> SetCookie("name","values",time(),"/",".domain.com"); or SetCookie("name","values",time(),"/","domain.com"); (without the period) </PRE> I don't understand this. I even had the browser check for the host from the Environment Variable "HTTP_HOST" and then write that as the host name in the cookie and it wouldn't work. Nothing writes. If I surf the website with www.domain.com then it will write the cookie if I code it like .domain.com, domain.com or www.domain.com.

« previous php.notes (#1193) next »