note 92804 added to function.setcookie
| From: | info at daniel-marschall dot de | Date: | Mon, 10 Aug 2009 14:16:30 +0000 |
| Subject: | note 92804 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159264@lists.php.net to get a copy of this message | ||
Be careful when setting a domain value. The browsers have curious results (I tested with FireFox 3
only!).
If session.cookie_domain is "", then your browser will probably make the cookie only
available for your domain "www.example.com". That's secure since subdomains probably
cannot access the cookie.
If the session.cookie_domain has a value, for example "www.example.com", all browsers
which are according to the RFC, will add a "." prefix to the domain. So
"www.example.com" will be converted to ".www.example.com" by the browser. Now
the cookie is not as secure as the cookie above since it is also accessable at subdomains.
Strange...
----
Server IP: 209.41.74.194
Probable Submitter: 87.165.187.45
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/92804
Del: integrated -- https://master.php.net/note/delete/92804/integrated
Del: useless -- https://master.php.net/note/delete/92804/useless
Del: bad code -- https://master.php.net/note/delete/92804/bad+code
Del: spam -- https://master.php.net/note/delete/92804/spam
Del: non-english -- https://master.php.net/note/delete/92804/non-english
Del: in docs -- https://master.php.net/note/delete/92804/in+docs
Del: other reasons-- https://master.php.net/note/delete/92804
Reject -- https://master.php.net/note/reject/92804
Search -- https://master.php.net/manage/user-notes.php