ASP.NET Authentication sliding expiry time on custom ticket

前端 未结 1 606
醉梦人生
醉梦人生 2020-12-30 08:14

I am creating my own authentication ticket using the following code:

string formsCookieStr = string.Empty;
FormsAuthenticationTicket ticket = new FormsAuthen         


        
1条回答
  •  悲哀的现实
    2020-12-30 08:35

    That's configured in the forms section of web.config. The way sliding expiration works is that on each request the ASP.NET engine rewrites the authentication cookie by incrementing the timeout:

    
      
    
    

    Note however that enabling sliding expiration is one of the things considered as bad practice in the ASP.NET Security Practices.

    0 讨论(0)
提交回复
热议问题