Setting cookie on one domain for an other domain
| From: | Peter Lauri | Date: | Thu, 20 Jul 2006 11:10:55 +0000 |
| Subject: | Setting cookie on one domain for an other domain | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239635@lists.php.net to get a copy of this message | ||
Best group member,
When a user does a specific action on domain1.com I want a cookie to be set
so that domain1.com and domain2.com can reach it. Ok, after reading the
manual for setcookie() I tried this:
setcookie("thevariable", "thevalue", time()+60*60*24*30, "/",
".domain1.com");
setcookie("thevariable", "thevalue", time()+60*60*24*30, "/",
".domain2.com");
However, I can not detect the cookie at domain2.com.
A solution would be to just make a redirect to the other domain where the
cookie is set and then return.
Question is: Can I not set a cookie at domain1.com to work at domain2.com?
Best regards,
Peter Lauri