I have a web application, and some users who use Chrome as their preferred browser of choice, get the following error when they have logged out of the application, and try to log back in.
"This webpage has a redirect loop".
My web application uses forms authentication, and the FormAuthenticationModule
redirects the user back to the Login page of my application, so I cannot use this approach:
<customErrors mode="On" defaultRedirect="~/MyErrorPage.aspx" >
<error statusCode="401" redirect="~/NoAccess.aspx"/>
</customErrors>
Instead, I have added the following to the Page_Load
event of my LoginPage
.
if (Request.IsAuthenticated && !string.IsNullOrEmpty(Request.QueryString["ReturnUrl"]))
{
Response.Redirect("~/NoAccess.aspx");
}
However, since I have added this approach, the users seem to get the "Redirect Loop" error.
After clearing the cookies, all seems well, but the problem does occur again.
Is there a permanent fix for this I can add to my code, or is there anything else I can do to prevent this issue from happening?