【问题标题】:ASP.NET Forms Authentication Ticket TimeoutASP.NET 表单身份验证票证超时
【发布时间】:2009-11-03 15:37:37
【问题描述】:

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

谢谢

【问题讨论】:

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


    【解决方案1】:

    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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-28
      相关资源
      最近更新 更多