title: ASPXAUTH cookie getting lost on jquery Ajax Call
body: <p>For some reason, after 2 or 3 calls, my cookie is no longer getting passed. Usually, after 3 requests, my cookie disappears from the request. I have no idea why. I am not making any cross domain calls. I did notice that on one of the responses that the ASPXAUTH cookie comes back in the Response Cookies (viewing in Google Chrome, network inspector) and is empty. In the Expire column it states "Session".  So, it seems that my cookie is getting passed back empty and that is why the authentication fails. I just don;t know why it works for 2 calls then get's passed back. I have tired setting the cookie not to expire, but that did not work. The response back form the server is a call to an MVC controller to return a partial view.</p>
  
  <p>Normal Request:</p>
  
  <pre><code>    Accept:application/json, text/javascript, */*; q=0.01
      Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Accept-Encoding:gzip,deflate,sdch
      Accept-Language:en-US,en;q=0.8
      Connection:keep-alive
      Content-Length:271
      Content-Type:application/json; charset=UTF-8
      Cookie:.ASPXAUTH=7B8EFA9A1F81CE1D400A054827A34719FF7E00161FA065A9637DF42A6F46CE2ECDA40216B88ADCADC0DBA712109BCDCD1A0E712019556C72CA76B52041057C480C6C8274CF0BCEA9DE4891457218B52EB96177754064DC24B0FEC1A0BF51364B16294CED53BAD0CEFC37AA70B92CF29407A307548135C4B7D35060BAE3DDE7031332049B67A62D108F84C1167552D73842B5D4CB83706A6B5787F019184371A8050364F8DFA83F7F1F8AE5A7CF8AB341F25D01E9761C735803D8AAFC97488FF3C7E0B272BCDB669B5E7E17C964402FC9B5E9514A1C105E172D09AB36077C961D5B1079AF6B10B17199AC3320BAC7F0A4A9C28987992D71385531A1E78B18AF7B
      Host:localhost:3182
      Origin:http://localhost:3182
      Referer:http://localhost:3182/Admin/UserAdmin/Profile/e82228b1-abbb-4ecf-a259-12b66f5f07ba
      User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
      X-Requested-With:XMLHttpRequest
  </code></pre>
  
  <p>Request after the cookie disappears:</p>
  
  <pre><code>Accept:application/json, text/javascript, */*; q=0.01
  Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:en-US,en;q=0.8
  Connection:keep-alive
  Content-Length:274
  Content-Type:application/json; charset=UTF-8    
  Host:localhost:3182
  Origin:http://localhost:3182
  Referer:http://localhost:3182/Admin/UserAdmin/Profile/e82228b1-abbb-4ecf-a259-12b66f5f07ba
  User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
  X-Requested-With:XMLHttpRequest
  </code></pre>
  
  <p><strong>UPDATE</strong>
  After struggling with this issue for a while now, I have decided to not use forms authentication and roll my own. I will be posting, on GIT, my solution in the coming days. From what I could see, something funky is going on with the response after an Ajax request and forms authentication. For some reason an empty auth cookie is getting sent back even though it is valid before the actual response is generated.</p>