【发布时间】:2014-04-05 22:06:04
【问题描述】:
我正在研究 ASP.NET 中的表单身份验证,但遇到了示例代码中的各种超时设置。在 web.config 本身中指定了两个超时。一种是 sessionState timeout="30" 并且在身份验证设置下 forms loginUrl="Login.aspx" protection="All" path="/" timeout="60"
除此之外,在登录页面C#的FormsAuthenticationTicket另外一次如下图
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1,
tableObject.Rows[0]["UserName"].ToString(),
DateTime.Now,
DateTime.Now.AddMinutes(40),
true,
"AuthenticatedUser",
FormsAuthentication.FormsCookiePath);
这些超时实际上是如何工作的?确保对页面提供良好保护的首选设置是什么?
【问题讨论】: