note 34612 added to function.setcookie

From: Date: Fri, 01 Aug 2003 01:47:49 +0000
Subject: note 34612 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-53126@lists.php.net to get a copy of this message
For login cookies, a mistake that I made, to the dismay of my users, was setting the cookie as follows: setcookie("username", "$username", time()+315360000, "/", "www.mydomain.com"); instead of just setcookie("username", "$username", time()+315360000, "/", "mydomain.com"); or even just setcookie("username", "$username", time()+315360000); While 95% of my users had no problems, a select few must have been neglecting to type "www" before the domain, and the cookies refused to set. My mistake, but man it took forever to find. ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34612 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34612&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34612&report=yes

« previous php.notes (#53126) next »