Asp.net mvc 身份验证会话超时

Asp.net mvc 身份验证会话超时,asp.net-mvc,asp.net-identity,Asp.net Mvc,Asp.net Identity,我使用的是VS2013.NET framework 4.5.1中MVC模板提供的内置身份框架 我使用的功能或多或少是开箱即用的。它一直运作良好。与我读过的其他帖子相比,我的web.config有: <authentication mode="None" /> 如何为经过身份验证的会话设置超时期限,即用户登录后?如果使用Owin身份验证,则在App\u Start文件夹中的StartUp.cs文件中应该有类似的内容: public void ConfigureAuth(IAppB

我使用的是VS2013.NET framework 4.5.1中MVC模板提供的内置身份框架

我使用的功能或多或少是开箱即用的。它一直运作良好。与我读过的其他帖子相比,我的web.config有:

<authentication mode="None" />


如何为经过身份验证的会话设置超时期限,即用户登录后?

如果使用Owin身份验证,则在
App\u Start
文件夹中的
StartUp.cs
文件中应该有类似的内容:

public void ConfigureAuth(IAppBuilder app)
{
    app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
        AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
        LoginPath = new PathString("/Account/Login"),
        // here you go
        ExpireTimeSpan = new TimeSpan(60000000000)
    });
    app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
}

这将对您有所帮助:是的,我遵循了本文中的步骤,它对我来说非常成功。我就是想不出如何设定一个时间。现在,登录会话永远有效。