.Net Form身份验证Request.IsAuthenticated总是返回false

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/xulong5000/article/details/102664481

两地地方注意一下

第一个地方 需要注意一点,就是timeout 。如果这个时间设置的比较小,在服务器上可以会返回 false

 <system.web>

   <authentication mode="Forms">  

   <forms name=".AspxFormAuth" loginUrl="/Account/Login" defaultUrl="/Home" domain=".xxx.com" protection="All" path="/" timeout="52560" /> <!-- domain=""-->  

 </authentication>

 </system.web>  

第二个地方:

<system.webServer>

   <modules runAllManagedModulesForAllRequests="true"></modules>

 </system.webServer>基本就没问题了                                    
                    
    
     
        
            
                
 

猜你喜欢

转载自blog.csdn.net/xulong5000/article/details/102664481
今日推荐