MVC 5 Identity Automatic Logout

前端 未结 1 774
礼貌的吻别
礼貌的吻别 2021-02-01 03:23

How do I implement an Automatic Logout Timer.

So basically if the user is inactive for x minutes their session is ended?

I have tried:



        
相关标签:
1条回答
  • 2021-02-01 03:47

    Its a property in the App_Start\Startup.Auth.cs file:

      app.UseCookieAuthentication(new CookieAuthenticationOptions
      {
          ExpireTimeSpan = TimeSpan.FromMinutes(5),
          AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
          LoginPath = new PathString("/Account/Login")
       });
    
    0 讨论(0)
提交回复
热议问题