【发布时间】: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 吗?