Michael Sole
asked on
Access cookie from a subdomain
I wanted to create a cookie in one subdomain and have it read by another. I thought if I set the cookie like this:
setcookie("OpenOffer", $xid, time()+3600,"/","domain.co m");
From the domain: subdomain1.domain.com
The I could read it:
$_COOKIE['OpenOffer'];
From www.domain.com but I can't
So I tried using an ajax request where I call subdomain1.domain.com and return the cookie value but that doesn't work either. I would of thought for sure this would of done it. Any help would be greatly appreciated
setcookie("OpenOffer", $xid, time()+3600,"/","domain.co
From the domain: subdomain1.domain.com
The I could read it:
$_COOKIE['OpenOffer'];
From www.domain.com but I can't
So I tried using an ajax request where I call subdomain1.domain.com and return the cookie value but that doesn't work either. I would of thought for sure this would of done it. Any help would be greatly appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window