ASP.NET Identity 2 Remember Me - User Is Being Logged Out
There is an explanation for TimeSpan
parameter in similar question. Simply use the infinite cookies, like this:
OnValidateIdentity = SecurityStampValidator
.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(0),
regenerateIdentity: (manager, user)
=> user.GenerateUserIdentityAsync(manager))
This is also needed for it to work correctly:
Call
await UserManager.UpdateSecurityStampAsync(userId);
before
AuthenticationManager.SignOut();
I think you should read this article . There are two different intervals: ValidateInterval
and ExpireTimeSpan
. And in your case i think you should change the expireTimeSpan
, not the ValidateInterval
.