tags:

views:

52

answers:

4

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

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
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
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
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

related questions