title: ASP.NET MVC 3 OnActionExecuting causes infinite loop
body: <p>I have that overriden OnActionExecuting method (to check before action execute if user is logged in)</p>
  
  <pre><code>public class AuthenticationAttribute : ActionFilterAttribute
  {
      public override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          if (!filterContext.HttpContext.User.Identity.IsAuthenticated)
          { 
              string redirectUrl = string.Format("?returnUrl={0}", filterContext.HttpContext.Request.Url.PathAndQuery);
  
              filterContext.HttpContext.Response.Redirect(FormsAuthentication.LoginUrl + redirectUrl, true);
          }
          else 
              base.OnActionExecuting(filterContext);
      }
  }
  </code></pre>
  
  <p>Why - if user is not logged in - the response is redirected to that method again. Why ?</p>