ASP.NET窗体身份验证故障单超时

时间:2009-11-03 15:37:38

标签: c# asp.net forms cookies forms-authentication

创建具有指定超时的自定义ASP.NET表单身份验证票证的最佳方法是什么?超时值来自数据库而不是web.config。

谢谢

1 个答案:

答案 0 :(得分:2)

Explained: Forms Authentication in ASP.NET 2.0

 FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
        "userName",
        DateTime.Now,
        DateTime.Now.AddMinutes(30), // value of time out property
        false, // Value of IsPersistent property
        String.Empty,
        FormsAuthentication.FormsCookiePath);