note 93641 added to function.setcookie

From: Date: Sun, 20 Sep 2009 21:29:23 +0000
Subject: note 93641 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-160871@lists.php.net to get a copy of this message
As <info at daniel-marschall dot de> points out, firefox will prepend a period (full-stop) to the domain value if the period is not already present. This is because firefox expects the domain parameter value, if present, to be a domain name and not a host name. So using setcookie() with a domain value of www.example.com is not correct if www is a host name. If you want to restrict the cookie to a single host, supply the domain parameter as an empty string, for example (note the rightmost parameter): <? setcookie("TestCookie", "SomeValue", time()+3600, "/~rasmus/", ""); ?> ---- Server IP: 92.48.74.199 Probable Submitter: 212.159.95.115 ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- https://master.php.net/note/edit/93641 Del: integrated -- https://master.php.net/note/delete/93641/integrated Del: useless -- https://master.php.net/note/delete/93641/useless Del: bad code -- https://master.php.net/note/delete/93641/bad+code Del: spam -- https://master.php.net/note/delete/93641/spam Del: non-english -- https://master.php.net/note/delete/93641/non-english Del: in docs -- https://master.php.net/note/delete/93641/in+docs Del: other reasons-- https://master.php.net/note/delete/93641 Reject -- https://master.php.net/note/reject/93641 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160871) next »