JuniorDeveloper
JuniorDeveloper

Reputation: 71

ASP.NET Forms Authentication Ticket Timeout

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

Upvotes: 1

Views: 1834

Answers (1)

rick schott
rick schott

Reputation: 20617

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

Upvotes: 2

Related Questions