rails/jquery-ujs — pull request #262 by bradphilips (2012-05-29 01:39:25+00:00)
Title: Modification to allow credentials to be passed with xhr requests

@JangoSteve - This change is to allow cross-domain requests with CORS (http://www.w3.org/TR/cors/) to allow the sending of cookies for cross domain authentication. I ran into this issue when I was attempting to re-direct from a non-secure (www.yourdomain.com) login form that posts into the secure domain (secure.yourdomain.com) or any other domain and the cookies were always getting dropped on the redirect. XHR allows this with a setting to pass cookies and CORS to explicitly allow it server side (https://developer.mozilla.org/en/http_access_control). I wasn't sure what to do for the unit test but I tried to mimic what you did for the data-cross-domain tag because I thought it was similar. I also cleaned up some of the lint warnings while I was in here. Let me know if you have questions/problems. Thanks!