1
votes

Whats the best way to create a custom ASP.NET forms authentication ticket with a specified timeout? The timeout value is coming from a database not the web.config.

Thanks

1

1 Answers

2
votes

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