ASP.NET Forms Authentication - Too many redirects

时间秒杀一切 提交于 2019-12-19 06:53:49

问题


I have an ASP.NET 4.5 webforms site and trying to setup forms authentication. I have an Account folder with a Login.aspx page within. The main web.config contains the following:

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<authorization>
  <deny users ="?" />
  <allow users = "*" />
</authorization>

When I browse to the site, it appropriate redirects to Account/Login.aspx and then throws a browser error indicating

Too Many Redirects

. I am at a loss as to what could be wrong or where to go to troubleshoot next. Any assistance would be appreciated.


回答1:


Please check if you have somewhere on your page that you have redirected to same page that you are in, or somewhere global, this endless loop. eg Response.Redirect("Login.aspx");




回答2:


I have seen this before and the issue was resolved by clearing cookies and browser history.




回答3:


Check that your ASP .net State Service is running. Starting this service resolved this problem for me.



来源:https://stackoverflow.com/questions/21272485/asp-net-forms-authentication-too-many-redirects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!