I have a website www.abc.com and i have a user for whom the url is name.abc.com. Then what is the procedure to use the same session for both the urls
views:
52answers:
4
A:
To create a domain wide cookie you have to set it's domain to ".example.tld" or in your case ".abc.com". In PHP you can do this e.g. with:
ini_set('session.cookie_domain', '.abc.com');
Cookie based sessions should then be available across all subdomains.
Best wishes,
Fabian
halfdan
2009-12-14 14:37:01
A:
I don't think there is a single best approach. You might want to read this SO post:
What’s your favorite cross domain cookie sharing approach?
And Googled results
o.k.w
2009-12-14 14:37:06
A:
In order for cookies to be shared between subdomains, the cookie domain must be .abc.com
. Setting the cookie domain varies between different programming languages/frameworks.
Jordan Ryan Moore
2009-12-14 14:38:57
A:
Let me reframe the question. I am using ASP.Net. How can I access session data of a domain in its sub domains. i.e accessing data of www.abc.com in xxx.abc.com
karthik
2009-12-15 11:13:32