Hi, I have published my website on IIS which is working in two ways. we can access the website using https://www.websitename.com and https://websitename.com. So, when logging in i am facing issue of session creation. If i logged in through one of the URL it is accessible to another URL due to session issue.
So, to resolve this i added cookie domain value in Startup.cs file in my project as follows, which is working fine. But when i click logout button, i am not able to logout.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
CookieDomain = ".websitename.com"
});
Is there any workaround to resolve this issue.
Thanks
4 Answer(s)
-
0
i am not able to logout.
Can you talk about it in detail?
-
0
Actually i added a code to redirect to welcome page if user is already logged in. So, that user don't have to go to login screen everytiem. Now, when i click on logout it redirect me again to welcome page like cookies are not cleared.
-
0
Please share the code you wrote.
-
0
Hi,
I have completed this by removing cookies from domain which i added. Now its working fine.
Thanks.