I have implemented asp.net mvc with asp.net id identification.
I used cookie based authentication. After restarting IIS / stop and starting IIS for my site, when I open my site, the user will automatically log in.
The user cookie is not cleared and remains valid for the user. How to get user to logout after iis reboot?
I used the default sample from the website.
http://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples

app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
source
share