Jump to content


Photo

Sharing cookie across multiple domains?


  • Please log in to reply
1 reply to this topic

#1 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 21 September 2006 - 01:27 AM

Is it possible to use a single cookie across multiple domains?

for instance, www.server1.com and www.server2.com

As you can see, this method here only allows for a single domain.

setcookie("TestCookie", $value, time()+3600, "/directory/", ".example.com", 1);

It's possible to set from 1 domain that applies to a completely different domain, correct?

DO you suggest I just create 2 cookies?

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 21 September 2006 - 01:28 AM

2 cookies is the way to go.  Cookies are set and read by the domain they're created from.

Info: PHP Manual





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users