Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Forms Authentication - Too many redirects

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.

like image 874
Todd Zetlan Avatar asked Jan 22 '14 01:01

Todd Zetlan


1 Answers

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");

like image 196
tarzanbappa Avatar answered Oct 25 '22 18:10

tarzanbappa