Skip to content

Commit

Permalink
Fixed steamID not being properly set when cookies have a domain attri…
Browse files Browse the repository at this point in the history
…bute
  • Loading branch information
DoctorMcKay committed Jan 18, 2024
1 parent e1820ef commit de95e25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ SteamCommunity.prototype._setCookie = function(cookie, secure) {

SteamCommunity.prototype.setCookies = function(cookies) {
cookies.forEach((cookie) => {
var cookieName = cookie.match(/(.+)=/)[1];
var cookieName = cookie.trim().split('=')[0];
if (cookieName == 'steamLogin' || cookieName == 'steamLoginSecure') {
this.steamID = new SteamID(cookie.match(/=(\d+)/)[1]);
this.steamID = new SteamID(cookie.match(/steamLogin(Secure)?=(\d+)/)[2]);
}

this._setCookie(Request.cookie(cookie), !!(cookieName.match(/^steamMachineAuth/) || cookieName.match(/Secure$/)));
Expand Down

0 comments on commit de95e25

Please sign in to comment.