title: Forms authentication cookie not sent in ajax post from http to https (the same domain)
body: <p>I'm sending AJAX form from page in http scheme to https url (the domain, and the appliaction is the same). I use MVC 3 Ajax helper:</p>
  
  <pre><code>@using (Ajax.BeginForm(MVC.Payment.Confirm(), new AjaxOptions
  {
      HttpMethod = "Post",
      UpdateTargetId = "myId",
      InsertionMode = InsertionMode.Replace,
      OnBegin = "$('#popupAjaxLoader').show();",
      OnSuccess = "$('#popupAjaxLoader').hide();",
      Url = "https://same.domain/payment/confirm"
  }, new { @action = "https://same.domain.com/payment/confirm" }))
  {   
  ...
  }
  </code></pre>
  
  <p>In the application I use forms authentication:</p>
  
  <pre><code>   &lt;forms loginUrl="~/Account/LogOn" timeout="2880" name="MYCOOKIENAME" /&gt;
  </code></pre>
  
  <p>In firebug I can see that the authentication cookie is not sent to the server when submiting the form, so the handler fails (the request need to be authorized).
  How can I force Ajax.BegiForm to attach authentication cookie?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>It turned out that the solution given by counsellorben works if there is no need to receive any information back from the ajax request. Sending Ajax POST from HTTP to HTTPS works fine (cookies are not attached, so you have to POST all neccessary data as hidden form fields), but the server response is not accessible for javascript because of Same Origin Policy.
  Eventually I had to abandon Ajax and place the form inside iframe referencing HTTPS url which seems to be the ultimate solution for this problem. </p>