title: AntiForgeryToken causing redirect loop
body: <p>So I have a very simple form on my page which looks like this</p>
  
  <pre><code>@using(Html.BeginForm("SomeAction", "SomeController", FormMethod.Post))
  {
      Html.AntiForgeryToken();
  
      // some other fields go here
  
      &lt;input type="submit" value="DoStuff" /&gt;
  }
  </code></pre>
  
  <p>and the action looks like this</p>
  
  <pre><code>[HttpPost]
  [Authorize]
  [ValidateAntiForgeryToken]
  public ActionResult SomeAction()
  {
      // Do some stuff here and return
  }
  </code></pre>
  
  <p>first of all, if I do not give the <code>AntiForgeryToken</code> method a salt parameter it does not generate any hidden field or anything like that containing a token, so clicking that submit button redirects to the error page, which says <code>required anti forgery field is not present</code>. Now, if I put any salt in there, for instance Username</p>
  
  <pre><code>Html.AntiForgeryToken(User.Identity.Name); // I Use FormsAuthentication
  </code></pre>
  
  <p>then the browser says, web page has a redirect loop. this is the first time I'm using AntiForgeryToken so I don't understand why this is happening. Can anyone help me out. Any help would be appriciated.</p>