0

I am unable to set a cookie in one domain and read it in another. I have tried a million different examples but i have had no luck at all.

can someone please point out what is going wrong?

domainone.com

setcookie('testcookie','cookie example',time()+30*24*60*60,'/','domaintwo.com',false,true)

domaintwo.com

echo $_COOKIE[testcookie];

var_dump($_COOKIE);
Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70
tlawson
  • 1
  • 1
  • 1
    possible duplicate of [php cookie cross 2 top level domains](http://stackoverflow.com/questions/4013204/php-cookie-cross-2-top-level-domains) – Pekka Nov 03 '10 at 10:24

1 Answers1

1

This is impossible. Search for Cross Domain Cookie related questions on SO to see workarounds (though none is trivial).

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088