
正文
[Asp.Net] Form验证中 user.identity为false
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
这个方法可以是user.identity设置为true
FormsAuthentication.SetAuthCookie(Username, true);
但是要开启form验证,
在配置文件中
<authentication mode="Forms"></authentication>
还有有的项目中默认移除了from验证的module, You need to remove this line
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
</modules>
</system.webServer>







