Why I am losing cookies and session on Ajax requests in IE 9 Why I am losing cookies and session on Ajax requests in IE 9 ajax ajax

Why I am losing cookies and session on Ajax requests in IE 9


These are just some ideas, which may help (and you've probably read or tried these by now). There doesn't seem to be a silver bullet.

Some other questions had similar problems, that don't seem to be exactly yours (especially since you tried P3P). Also lots of posts in general on the internet, all around the same few issues.

No Session Cookies on Internet Explorer 9 AJAX requests

Cookie blocked/not saved in IFRAME in Internet Explorer

Some ideas:

  • One answer had problems with underscore in the url. You don't havethat, but can you try a clean one without the random parameter? Justin case it doesn't like that.
  • Lots of posts about trouble doing thisfrom within an iframe. If you don't have an iframe, this isn't theproblem.
  • P3P, you said you tried; I saw one comment that the headerhas to be set on every request, not just the ones looking forsession/cookies.
  • Cross-domain / CORS problem? Doesn't look like itwith your root-relative url.
  • Try an IE9 on another computer? Silly,but maybe it's some obscure setting on your browser; zones, etc.
  • Does fiddler show a session id on a regular page browsed on your site? (just to make sure it's not site-wide vs. just this ajax call).

  • I usually Post ajax instead of Get (just had a lot of data), and dohave session working. This also avoided needing the cache-bustingrandom parameter.

  • I'm using good old web forms instead of mvc, and posting to asmx. Onthe asmx method, I need to decorate the server-side method.

    // ScriptService and ScriptMethod are required for the jquery.ajax() call. They weren't required for jquery.post(). WebMethod needed for session.[WebMethod(EnableSession = true)][ScriptMethod]public string DoSomething() ...