From 0384cc4f150e321379981bd1762e2e629269c569 Mon Sep 17 00:00:00 2001 From: Marek Majkowski Date: Fri, 19 Aug 2011 17:58:32 +0100 Subject: [PATCH] Do accept cookies with CORS. --- lib/utils.js | 4 ++++ 1 file changed, 4 insertions(+) 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