IIS+Framework3.5下 Form身份认证失败
.net Framework为3.5,在VS2008的虚拟服务器中运行没有问题,但是发布到IIS6.0中就提示尚未登录。
Web.config中的设置:
<authentication mode="Forms">
<forms name="forums" path="/" loginUrl="Login.aspx" protection="All" timeout="40">
</forms>
</authentication>
后台程序中:
if(...) // 用户名和密码正确
{
FormsAuthentication.SetAuthCookie(uid, false);
}
调试时发现:即使成功登陆后,VS2008虚拟服务器中运行时Context.User.Identity.IsAuthenticated为true,但IIS6.0下运行时就为false。
之前是Framework2.0时,两边都正常。
请问这是什么原因,那里还要配置?(IIS中已配置为应用程序)