diff --git a/index.js b/index.js index 911498d..c38f109 100644 --- a/index.js +++ b/index.js @@ -154,9 +154,13 @@ SteamCommunity.prototype._setCookie = function(cookie, secure) { var protocol = secure ? "https" : "http"; cookie.secure = !!secure; - this._jar.setCookie(cookie.clone(), protocol + "://steamcommunity.com"); - this._jar.setCookie(cookie.clone(), protocol + "://store.steampowered.com"); - this._jar.setCookie(cookie.clone(), protocol + "://help.steampowered.com"); + if (cookie.domain) { + this._jar.setCookie(cookie.clone(), protocol + '://' + cookie.domain); + } else { + this._jar.setCookie(cookie.clone(), protocol + "://steamcommunity.com"); + this._jar.setCookie(cookie.clone(), protocol + "://store.steampowered.com"); + this._jar.setCookie(cookie.clone(), protocol + "://help.steampowered.com"); + } }; SteamCommunity.prototype.setCookies = function(cookies) { diff --git a/package.json b/package.json index 2b13c8f..54f72a4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "cheerio": "0.22.0", "image-size": "^0.8.2", "request": "^2.88.0", - "steam-session": "^1.6.0", + "steam-session": "^1.7.2", "steam-totp": "^1.5.0", "steamid": "^1.1.3", "xml2js": "^0.6.2"