title: The required anti-forgery cookie "__RequestVerificationToken" is not present
body: <p>My website is raising this exception around 20 times a day, usually the form works fine but there are instances where this issue occur and I don't know why is so random.</p>
  
  <p>This is logged exception by elmah</p>
  
  <blockquote>
    <p>500   HttpAntiForgery The required anti-forgery cookie __RequestVerificationToken" is not present.</p>
  </blockquote>
  
  <p>But the form it is sending the the token as shown on the XML log by elmah</p>
  
  <pre><code>&lt;form&gt;
      &lt;item name="__RequestVerificationToken"&gt;
        &lt;value string="DNbDMrzHmy37GPS6IFH-EmcIh4fJ2laezIrIEev5f4vOhsY9T7SkH9-1b7GPjm92CTFtb4dGqSe2SSYrlWSNEQG1MUlNyiLP1wtYli8bIh41"/&gt;
      &lt;/item&gt;
      &lt;item name="toPhone"&gt;
        &lt;value string="XXXXXX"/&gt;
      &lt;/item&gt;
      &lt;item name="smsMessage"&gt;
        &lt;value string="xxxxxxxx"/&gt;
      &lt;/item&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my method on the controller which uses the data Attribute to check if the token is valid or nor</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public async Task&lt;JsonResult&gt; Send(SMSModel model)
  {
      // my code goes here
  }
  </code></pre>
  
  <p>This is my form on the view</p>
  
  <pre><code>@using (Html.BeginForm("Send", "SMS", FormMethod.Post, new { @class = "form-sms", autocomplete = "off" }))
  {
      @Html.AntiForgeryToken()
      &lt;div class="row"&gt;
          &lt;div class="col-md-12"&gt;
              &lt;div class="form-group"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;div class="input-group-addon"&gt;+53&lt;/div&gt;
                      @Html.TextBoxFor(m =&gt; m.toPhone, new { @class = "form-control", placeholder = "teléfono", required = "required", type = "tel", maxlength = 8 })
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="form-group" style="position:relative"&gt;
          &lt;label class="sr-only" for="exampleInputEmail3"&gt;Message (up to 135 characters)&lt;/label&gt;
          @Html.TextAreaFor(m =&gt; m.smsMessage, new { rows = 4, @class = "form-control", placeholder = "escriba aquí su mensaje", required = "required", maxlength = "135" })
          &lt;span class="char-count"&gt;135&lt;/span&gt;
      &lt;/div&gt;
      if (ViewBag.Sent == true)
      {
          &lt;div class="alert alert-success alert-dismissible" role="alert"&gt;
              &lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
              &lt;strong&gt;Su mensaje ha sido enviado &lt;span class="hidden-xs"&gt;satisfactoriamente&lt;/span&gt;&lt;/strong&gt;
          &lt;/div&gt;
      }
      if (ViewBag.Error == true)
      {
          &lt;div class="alert alert-danger alert-dismissible" role="alert"&gt;
              &lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
              &lt;strong&gt;Error:&lt;/strong&gt; Por favor revise el número de teléfono.
          &lt;/div&gt;
      }
      &lt;div class="errorToMany"&gt;&lt;/div&gt;
      &lt;button type="submit" class="btn btn-default btn-block"&gt;Enviar SMS&lt;/button&gt;
  }
  </code></pre>
  
  <p>And this how I post my data using AJAX</p>
  
  <pre><code>$('form.form-sms').submit(function (event) {
      $.ajax({
          url: $(this).attr("action"),
          type: "POST",
          data: $(this).serializeArray(),
          beforeSend: function (xhr) {
              $('.btn-default').attr("disabled", true);
              $('.btn-default').html("Enviando...")
          },
          success: function (data, textStatus, jqXHR) {
              if (data[0] == false &amp;&amp; data[1] == "1") {
                 some code 
              } else {
                 location.reload();
              }
          },
          error: function (jqXHR, textStatus, errorThrown) { }
      });
      return false;
  });
  </code></pre>
  
  <p>The form works well most time but this error keeps happening and I don't know why, I've checked other questions here on Stack Overflow but nothing works for me.</p>
  
  <p>For further explanation about how I post the data.</p>
  
  <p>This form to send SMS has the fields ToNumber and Message. When a user clicks on the submit Button the AJAX function takes control and post it serializing the form's field data, when my function in the controller finishes and return the JSON result indicating everything went well, the AJAX method reloads the page showing the user a success message.</p>
  
  <p>Any ideas what could be causing this issue.</p>