郁闷!!散分
7707 2006-06-29 09:00:07 以前做的一个论坛,身份验证用forms验证,最近转到vs2005下,发觉自动登录功能不能用了,无论
FormsAuthentication.SetAuthCookie("username", true)
还是FormsAuthentication.SetAuthCookie("username", false)
cookie有效期都是web.config中的timeout值...
输出Request.Cookies[FormsAuthentication.FormsCookieName].Expires值为0001-1-1 0:00:00
<authentication mode="Forms">
<forms loginUrl="login.aspx" name=".test" protection="All" path="/" timeout="30"/>
</authentication>
login.aspx:
...
FormsAuthentication.SetAuthCookie(TextBox1.Text, true);
Response.Redirect("default.aspx");