title: Setting cookie when an Ajax requested is returned from a different domain
body: <p>I have a mobile web app which requires basic authentication. I managed to invoke a basic authentication with Ajax on a server that is of different domain. However, I have a problem with the response. </p>
  
  <p>Normally, a session id would be set in the browser by the Ajax response through the set cookie header. I noticed that this didn't happen upon successful authentication. </p>
  
  <p>What I did was to try to set the cookie manually by reading the headers when the response is returned. I achieved this via jQuerys jqxhr object. To my surprise even though the server indicated that a sessionID was returned, I was unable to see any set cookie header in the response through jqxhr.</p>
  
  <p>Is this the expected behavior of a cross domain request? That some response headers would get dropped? Is this a security feature of the browser? If so, what would you suggest to work around this (eg. Return the session id in the body, which I don't want to because I'm using Shiro security filter in the backed to take care of this, I don't want to need to hack it)?</p>
  
  <p>Please help</p>