Asp.net mvc 会话过期时如何重定向到登录页asp.net MVC 5 asp.net Identity 2.0
我已使用最新的ASP.net Identity 2.0在VS2013中创建了默认webproject。我想知道需要什么设置来更改日志会话的超时,以便我可以进行实际测试。您可以在Startup.Auth.cs中跳过此设置Asp.net mvc 会话过期时如何重定向到登录页asp.net MVC 5 asp.net Identity 2.0,asp.net-mvc,asp.net-mvc-5,asp.net-identity,Asp.net Mvc,Asp.net Mvc 5,Asp.net Identity,我已使用最新的ASP.net Identity 2.0在VS2013中创建了默认webproject。我想知道需要什么设置来更改日志会话的超时,以便我可以进行实际测试。您可以在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
// 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)
});