title: Getting err_too_many_redirects in HandleUnauthorizedRequest
body: <p>I am working in MVC. I got error </p>
  
  <blockquote>
    <p>err_too_many_redirects</p>
  </blockquote>
  
  <p>in </p>
  
  <blockquote>
    <p>HandleUnauthorizedRequest</p>
  </blockquote>
  
  <p>.  </p>
  
  <pre><code>public class AuthCheckService : AuthorizeAttribute
  {
      protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
      {
          if (filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
          {
              //Ajax request doesn't return to login page, it just returns 403 error.
              filterContext.HttpContext.Response.Clear();
              filterContext.HttpContext.Response.StatusCode = 501;
              throw new ModelStateException("Your Session has expired- Please login again!");
          }
          else
          {
              base.HandleUnauthorizedRequest(filterContext);
              //filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary(new { action = "Login", controller = "Account" }));
          }
  
      }
  }
  </code></pre>
  
  <p>Please let me know where i am going wrong?</p>