note 35798 added to function.setcookie

From: Date: Mon, 15 Sep 2003 09:22:37 +0000
Subject: note 35798 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-56505@lists.php.net to get a copy of this message
For many this may be obvious but for those, like me, who have never had this problem before I hope it saves them many hours head scratching. I spent several hours trying to work out why a cookie that had been working for 6 months suddenly stopped working on some browsers. The setcookie I had was: setcookie("custid",$id, time()+315360000, "/", "domname.com"); It appears the problem was with the domain name part and to work on some browsers a '.' is required in front of the domain name ie: setcookie("custid",$id, time()+315360000, "/", ".domname.com"); ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35798 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35798&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35798&report=yes

« previous php.notes (#56505) next »