【问题标题】:Request.IsAuthenticated returns false when using Intelligencia rewriter for ASP.NET使用 Intelligencia rewriter for ASP.NET 时,Request.IsAuthenticated 返回 false
【发布时间】:2013-03-12 02:45:33
【问题描述】:

我正在为 ASP.NET 使用 Intelligencia 重写器。现在我在项目中添加了表单身份验证,出于某种原因,在 seo 友好页面 (.html) 上,Request.IsAuthenticated 属性始终为 false。我可以看到使用 fiddler 可以很好地创建 cookie。当我访问任何其他 .aspx 页面时,我可以看到相同的属性是正确的。显然这与重写器有关,但是我根本找不到任何解决方案。

【问题讨论】:

    标签: asp.net forms-authentication urlrewriter


    【解决方案1】:

    我花了很长时间阅读互联网上的所有解决方案,但在我的情况下,它最终归结为缺少 web.config 设置:

    <authentication mode="Forms">
        <forms loginUrl="~/User/LogIn" timeout="2880" />  
    </authentication>
    

    如果没有指定身份验证,则不会使用身份验证,尽管您可能存在身份验证 cookie。

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-10-17
        • 2011-02-22
        • 2018-06-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多