Link to home
Start Free TrialLog in
Avatar of dale_abrams
dale_abrams

asked on

PHP Expire Sub Domain Cookies

I have control over abc.domain.com and I want to add a logout link to my site that will log users out of abc.domain.com and xyz.domain.com. Is this possible, or do I only have control over cookies from abc.com? If so, how would I expire the xyz cookie?
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dale_abrams
dale_abrams

ASKER

Thanks for the response Ray. It turns out that setcookie() is not able to administrate a cookie on xyz.domain.com if the user is on abc.domain.com. The sub domains are treated as being completely different domains and browsers block the ability to cross reference other cookies.
Can you please post the SSCCE that illustrates that?  I'll be glad to test it out to see if there is a workaround.  It might be possible to remove domain.com, thereby removing both abc.domain.com and xyz.domain.com, however this might only be possible if the cookie was originally set for domain.com - a recondite conundrum.
I wasn't able to get this working with your suggestion, but as the only one to attempt to help me, you deserve the points. Thanks Ray.
Why didn't you answer my requests for information?  Why did you give the worst possible grade anyone can give a fellow colleague at EE?  Please explain and tell me what you expected from me that you did not get?