0

I have one mvc5 application with few subdomains like this:

  • example.com
  • ex1.example.com
  • ex2.example.com

When I log in to example.com i'm not logged in other subdomains. I added in web.config following node:

<authentication mode="Forms">
    <forms name=".ASPXAUTH" loginUrl="~/Account/Login/" protection="Validation" timeout="120" path="/" domain=".example.com"/>
</authentication>

But it still doesnt work :(

Please help.

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Ellbar
  • 3,984
  • 6
  • 24
  • 36

1 Answers1

2

Check that you are using the same machine key for for each of the applications in the subdomains. Also you may need to set the machine key compatibility mode to Framework20SP2.

Edit:

Take a look at this post as well: ASP.NET Identity Cookie across subdomains

Community
  • 1
  • 1
James Santiago
  • 2,883
  • 4
  • 22
  • 29
  • But I use One application. Every subdomain points to thge same website. EDIT: I tried to do this for independent websites on the same hosting serwer and it still doesn't work :( – Ellbar Jan 01 '14 at 10:58
  • Hey. Your solution worked when I had one application with few subdomains. Now I have one application for each subdomain and it doesn't work :( – Ellbar Jan 01 '14 at 13:01