Johnny Johnny - 4 months ago 62
ASP.NET (C#) Question

mvc - multiple domains for single page with single login

I have MVC 4 website, where are 4 access points :

Problem is, that when user is logged on one of these url addresses, then user is not logged on another urls. So, for example after login to "" user is not logged in to "", this behavior applies for all access points.

User can be logged on all access points in same time, but he must fill login form 4 times.

There can be URL rewrite from non-www to www, but there are still 2 domains (.com/.net).

In IIS are all hostname shapes in single site bindings.

Any idea what I am doing wrong?


I have a website with similar domain extensions, including the https protocol, I forwarded all other domains to, its good for SEO reasons as well and for your analytics, I would suggest forward all domains to one single domain.

This answer also says:

So, how to share the authentication cookie across multiple domains? Well, there is absolutely no way to do that. The fundamental barrier of the HTTP protocol prevents you from sharing a cookie across different domains, primarily for security reasons.

...There is no built-in mechanism in ASP.NET to implement a Single Sign On across these two different sites.

You can redirect the website using web.config file by setting up sites in IIS to the redirect folder:

<?xml version="1.0" encoding="UTF-8"?>
        <httpRedirect enabled="true" destination="$S$Q" exactDestination="true" httpResponseStatus="Permanent" />