FormsAuthentication.SetAuthCookie无法改变Request.IsAuthenticated的状态
其原因可能是web.config中使用的验证模式是windows的,改为如下即可:
<authentication mode="Forms">
<forms name=".ASPXAUTH" protection="All" timeout="60" />
</authentication>
其原因可能是web.config中使用的验证模式是windows的,改为如下即可:
<authentication mode="Forms">
<forms name=".ASPXAUTH" protection="All" timeout="60" />
</authentication>
博客指出FormsAuthentication.SetAuthCookie无法改变Request.IsAuthenticated状态,原因可能是web.config中验证模式为windows,解决办法是将验证模式改为Forms,如<authentication mode=\Forms\><forms name=\.ASPXAUTH\ protection=\All\ timeout=\60\ /></authentication>。





