Fixed cookies not being set for non-community domains after logging in

Also fixed secure flag not working for cookies
This commit is contained in:
Alexander Corn 2016-09-12 11:22:18 -04:00
parent 5928c3b76a
commit 71a3893636

View File

@ -164,6 +164,8 @@ SteamCommunity.prototype.login = function(details, callback) {
break; break;
} }
} }
self.setCookies(cookies);
callback(null, sessionID, cookies, steamguard, oAuth.oauth_token); callback(null, sessionID, cookies, steamguard, oAuth.oauth_token);
} }
@ -217,6 +219,7 @@ SteamCommunity.prototype.oAuthLogin = function(steamguard, token, callback) {
SteamCommunity.prototype._setCookie = function(cookie, secure) { SteamCommunity.prototype._setCookie = function(cookie, secure) {
var protocol = secure ? "https" : "http"; var protocol = secure ? "https" : "http";
cookie.secure = !!secure;
this._jar.setCookie(cookie.clone(), protocol + "://steamcommunity.com"); this._jar.setCookie(cookie.clone(), protocol + "://steamcommunity.com");
this._jar.setCookie(cookie.clone(), protocol + "://store.steampowered.com"); this._jar.setCookie(cookie.clone(), protocol + "://store.steampowered.com");