note 47397 added to function.session-set-cookie-params
| From: | jordiatjcanalsdotnet at osu1 dot php dot net | Date: | Mon, 15 Nov 2004 13:39:46 +0000 |
| Subject: | note 47397 added to function.session-set-cookie-params | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-80537@lists.php.net to get a copy of this message | ||
Something that has taken me some time to debug: session_set_cookie_params() does not work when the
domain param is just a one level domain, like it was a TLD.
I have a site in an intranet and our internal domain is .local, so trying to set the cookie session
to the .local domain does not work:
session_set_cookie_params(0, '/', '.local'); // Does not work
In all test I've done, setting the domain only works for SLDs and above:
session_set_cookie_params(0 , '/', '.sld.local'); Does work
This is nothing to do with PHP but the http protocol, witch does not permit setting cookies for TLDs
for obvious security reasons.
----
Manual Page -- http://www.php.net/manual/en/function.session-set-cookie-params.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47397
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47397&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47397&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47397&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47397&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47397&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47397&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47397&report=yes
Search -- http://master.php.net/manage/user-notes.php