title: "The anti-forgery token could not be decrypted"
body: <p>I am running IIS 8.5 on a load-balanced (two-node) web farm.  We are getting sporadic errors:  </p>
  
  <pre><code>System.Web.Mvc.HttpAntiForgeryException (0x80004005): The anti-forgery
  token could not be decrypted....
  </code></pre>
  
  <p>I have tried/checked various solutions:</p>
  
  <ul>
  <li>At the server-wide level, I created explicit validation and decryption keys as described <a href="https://blogs.msdn.microsoft.com/vijaysk/2009/05/13/iis-7-tip-10-you-can-generate-machine-keys-from-the-iis-manager/" rel="nofollow noreferrer">here</a>, and have synchronized them across both nodes.  One thing to note is that for now, I left "Generate a unique key for each application" unchecked.</li>
  <li>The token is only generated once per page to avoid the problem described <a href="https://stackoverflow.com/a/28620686/567736">here</a>.</li>
  </ul>
  
  <p>But the errors persist.</p>
  
  <p>What can I do next to troubleshoot?</p>
  
  <hr>
  
  <p>EDIT: </p>
  
  <p>Controller code:</p>
  
  <pre><code>[HttpGet]
  public ActionResult Index()
  {
      var model = new LoginModel();
      return View(model);
  }
  </code></pre>
  
  <p>Relevant view code:</p>
  
  <pre><code>@using (Html.BeginForm())
  {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true)
  
      &lt;h1&gt;Log In&lt;/h1&gt;
      &lt;fieldset&gt;
          &lt;label&gt;Email&lt;/label&gt;
          @Html.TextBoxFor(model =&gt; model.Username)                        
          &lt;label&gt;Password&lt;/label&gt;
          @Html.PasswordFor(model =&gt; model.Password)
          &lt;input type="submit" /&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>