0

I'm looking into a multitenant application implemented in ASP.NET MVC. As per my requirement, I need to maintain a single session for all of the subdomains/domains pointing to my server IP. This setup is working fine in case of subdomains. But in case of cross domains(third party domains) set up is breaking. The way that I'm implementing them in case of subdomains using : i.e. I'm setting wildcard domain into web.config to share session between all subdomains of my domain pointing to same server.

The scenario is I'm having three domains like :

  1. abc.com
  2. x.abc.com
  3. def.com

abc.com is my website's parent domain. During a user visit I'm storing some info into session and then if someone is navigating to x.abc.com then I want the same info available on this current domain also. I've made that feasible by modifying web.config (i.e. adding httpcookies tag for my wildcard domain). But the same thing is not available on def.com. I'm looking for a setup that will make these sessions available on cross domains also i.e. on def.com also.**

But I've no idea to share sessions on cross domains. As I've found on some of the blogs that ASP.NET do allow to share sessions across domains. So is there any way to do so.

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
  • I have had success with subdomain too, however have not done it across root domains. My first thought is to remove dependence on the native session store and use a shared cache (Windows Azure Cache, CouchBase, Memcached, etc.) and to configure a provider across both domains to utilize it. That said, however, sessions are still maintained via cookies and a Session Token, which can't be shared across root domains (to my knowledge, there may be a way.) You'd need to persist a token on the server and link across your apps (single sign on, or SSO, style). Hopefully this helps you in your search. – trnelson Mar 13 '14 at 19:07
  • possible duplicate of [Cross Domain Login - How to login a user automatically when transferred from one domain to another](http://stackoverflow.com/questions/342378/cross-domain-login-how-to-login-a-user-automatically-when-transferred-from-one) – Erik Philips Mar 13 '14 at 19:52

0 Answers0