The problem is that the same cookie is used to authenticate two different logins.
The solution from what I understand is to give different cookie names for different logins, so one cookie does not overwrite another.
Perhaps the solution is on web.config.
In configuration
Change the name value to something else in your two applications if you have the same domain and are running in different directories / applications, or change the domain value that was also used to store the cookie.
<authentication mode="Forms"> <forms name=".CookieSuffix" domain="yoururl.com" ... /> </authentication>
For example, on two different websites in your applications, put on application 1: name = ". App1"
on application 2: name = ". app2"
Or on app 1: domain = "app1.yoururl.com"
on application 2: domain = "app2.yoururl.com"
if you are separating your apps, based on the url, or even trying to use some similar hints.
The cookie is saved using the cookie name in the domain name, so these are 2 values ββthat you should try to separate from them.
Details on setting up the form can be found here: http://msdn.microsoft.com/en-us/library/aa480476.aspx
Manual Entry
If you have the option to manually log in, the solution is in this function
FormsAuthentication.GetAuthCookie(cUserName, false, "cookiePath"); FormsAuthentication.SetAuthCookie(cUserName, false, "cookiePath");
You just need to use a different cookiePath, but you have to change a lot of points in your program and capture the login, log out and authenticate.
Hope this helps you.
Aristos
source share