note 55176 added to function.setcookie
| From: | Nat at osu1 dot php dot net | Date: | Wed, 27 Jul 2005 03:58:36 +0000 |
| Subject: | note 55176 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92524@lists.php.net to get a copy of this message | ||
I have 2 domains and i want to set cookie on a first one, and after to use it on a second one (in
fact, there are many domains and subdomains, but i have to set cookie in a one place). I'd
tried 2 ways, but seems it's imposible to do this at all.. Is anybody knows??
I.
// Setcookie on domain1.ab
setcookie("mycook", "something", time()+86400,"\",
".domain2.ab");
// On domain2.ab
echo $_COOKIE["mycook"];
-->It doesn't works..
II.
// Setcookie on domain1.ab
require '/domain2.ab/1.php';
// On domain2.ab, in 1.php
setcookie("mycook", "something", time()+86400,"\",
".domain2.ab");
//After on domain2.ab:
echo $_COOKIE["mycook"];
-->It doesn't works too.
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55176
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55176&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55176&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55176&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55176&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55176&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55176&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55176&report=yes
Search -- http://master.php.net/manage/user-notes.php