How to set asp.net Identity cookies expires time

后端 未结 4 540
Happy的楠姐
Happy的楠姐 2020-12-12 21:09

I use Asp.Net Identity to control my app\'s authorization. Now, I need to do this: if the user does not operate in 30 minutes, jump to the login page, when he login does not

4条回答
  •  醉话见心
    2020-12-12 21:20

    Use this...

    public void ConfigureAuth(IAppBuilder app)
    {
      app.UseCookieAuthentication(new CookieAuthenticationOptions
      {
          ExpireTimeSpan = TimeSpan.FromHours(1),
      });            
    }
    

提交回复
热议问题