【问题标题】:localhost redirected you too many times. - ERR_TOO_MANY_REDIRECTSlocalhost 将您重定向了太多次。 - ERR_TOO_MANY_REDIRECTS
【发布时间】:2017-06-29 02:43:26
【问题描述】:

我一直收到这个错误。无法弄清楚问题是什么。我尝试清除我的 cookie / 整个浏览历史仍然没有运气。

在我的 index.aspx 中,page_load 上有以下代码

protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated == true)
        { 
             Response.Redirect(FormsAuthentication.DefaultUrl, true);
        }   
    }

在网络配置中我有这个:

  <authentication mode="Forms">
        <forms cookieless="UseCookies" defaultUrl="app_files/home.aspx" loginUrl="index.aspx" name="osivms" path="/" protection="All" requireSSL="true" slidingExpiration="true" timeout="525600" />
    </authentication>

虽然有时它确实有效.. 但它确实是随机的,我不知道它在工作时发生了什么变化.. 然后在我点击刷新或其他东西后我再次收到相同的错误消息......

【问题讨论】:

  • 信息真的不够。 Response.Redirect(FormsAuthentication.DefaultUrl, true); 带你去哪里?
  • 到:app_files/home.aspx
  • 你贴的c#代码在哪里?
  • 每次加载索引页面时,您都在尝试进行身份验证。您的 app_files/home.aspx 页面是做什么的?它会重定向回你的 index.aspx 吗?

标签: c# asp.net .net


【解决方案1】:

此问题已修复。我按照page 上的说明进行操作,我的 localhost 现在又可以正常工作了。

我不得不删除旧证书并创建一个自签名的新证书并将其绑定到站点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-22
    • 2020-01-03
    • 1970-01-01
    • 1970-01-01
    • 2020-08-26
    • 1970-01-01
    • 2020-06-01
    • 2021-03-21
    相关资源
    最近更新 更多