Search code examples
asp.netsession-cookiesmultiple-domainswebsite-deployment

How to share session among Multiple Domains on single asp.net website?


I want to share session cookie among domains.

I have more than one domain: -

1. mydomain.com
2. mydomain.fr
3. mydomain.de
4. mydomain.da
...and many other language based

Now, I have single website deployed on a server. I want to share session among the different domains on the single website. How do I achieve this?

I found on web <httpCookies domain=".mydomain.com" /> but it work with sub domains (like test.mydomain.com and secure.mydomain.com) but not for the different domains.

I also tried <httpCookies domain=".mydomain." /> but by this session stopped working.

Could anyone help me please?


Solution

  • You can't share cookies on domains that have different top level domain name.

    This is only possible to do with subdomains.

    mydomain.com
    fr.mydomain.com
    de.mydomain.com
    da.mydomain.com
    ...