I log in using PasswordSignInAsync
function like
var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.Remember, shouldLockout: false);
And field model.Remember (isPersistent)
is false.
And in my Startup class, I have some code like
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))
}
});
What I would like to achieve is not only logging out the user after 30 minutes, but also after closing the browser.