Reputation: 71
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
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