我在VS2013中使用最新的ASP.net Identity 2.0创建了默认的web项目。我想知道需要什么设置来改变日志会话的超时,以便我可以实际测试。
你可以在Startup.Auth.cs中重写这个
// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
// Configure the sign in cookie
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(1),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
},
//*** This will override the default ****
ExpireTimeSpan = TimeSpan.FromMinutes(1)
});