diff --git a/lib/web3/httpprovider.js b/lib/web3/httpprovider.js index e12ebc0a819..71e2cd8c2ee 100644 --- a/lib/web3/httpprovider.js +++ b/lib/web3/httpprovider.js @@ -34,7 +34,7 @@ if (typeof window !== 'undefined' && window.XMLHttpRequest) { XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore: line } -var XHR2 = require('xhr2'); // jshint ignore: line +var XHR2 = require('xhr2-cookies').XMLHttpRequest; // jshint ignore: line /** * HttpProvider should be used to send rpc calls over http @@ -63,6 +63,7 @@ HttpProvider.prototype.prepareRequest = function (async) { } else { request = new XMLHttpRequest(); } + request.withCredentials = true; request.open('POST', this.host, async); if (this.user && this.password) { diff --git a/package.json b/package.json index 4419a8023fb..0269eccaf3d 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git", "crypto-js": "^3.1.4", "utf8": "^2.1.1", - "xhr2": "*", + "xhr2-cookies": "^1.1.0", "xmlhttprequest": "*" }, "browser": {