首页 新闻 会员 周边

Request.IsAuthenticated一直为TRUE,调试发现httpContext.User.Identity.Name默认取到Windows登录账号。

0
悬赏园豆:20 [已解决问题] 解决于 2018-12-02 21:34

Request.IsAuthenticated一直为TRUE,调试发现httpContext.User.Identity.Name默认取到Windows登录账号。

使用FormsAuthentication.SignOut()注销,还是不行。

web.config也没有什么特殊的配置:

<httpRuntime targetFramework="4.5" maxRequestLength="2097151" requestLengthDiskThreshold="256" />
<compilation debug="true" targetFramework="4.5" />
<authentication mode="Forms">
  <forms loginUrl="~/Account/Login" timeout="1" />
</authentication>

请大神帮我瞧瞧,谢谢了!

又沙又甜的主页 又沙又甜 | 初学一级 | 园豆:120
提问于:2017-06-06 08:53
< >
分享
最佳答案
0

看看你的登录代码

收获园豆:20
西漠以西 | 小虾三级 |园豆:1675 | 2017-06-06 17:22

 未登录状态下,Request.IsAuthenticated也为true.

又沙又甜 | 园豆:120 (初学一级) | 2017-06-08 12:10
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册