diff --git a/lib/utils.js b/lib/utils.js index c7ff1bf2..a0131ec5 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -156,6 +156,10 @@ utils.createXHR = function(method, url, payload, callback) { delete xhrDefaultHeaders[k]; } } + if ('withCredentials' in xhr) { + // Set cookies on CORS, please. + xhr.withCredentials = "true"; + } var cleanup = function() { // IE needs this field to be a function