I have two ASP.NET MVC applications with session configurations. When I log in from app1, that login is successful. After logging in from app2, it overwrites app1’s session cookie and successfully logs in app2. But refreshing the app1 result redirects to the login page.
- Both app1 and app2 cookie path is "/".
- Both app1 and app2 running on the same IIS server.
- Both app1 and app2 cookie name is unique.
I tried to change the session cookie path but it did not work.
2
Answers
I fixed that by adding the cookie name to the UseCookieAuthentication pipeline in app2. Thanks everyone!
Make your cookie http only so that way your cookie will be based on your domain like following.