views:

362

answers:

1

Hi, 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  A: 

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