nokill_me Posted March 16, 2017 Report Posted March 16, 2017 Hi i using this code for login function login(err, sessionID, cookies, steamguard) { if(err) { logger.error('Auth error'); logger.debug(err); if(err.message == "SteamGuardMobile") { account.twoFactorCode = SteamTotp.generateAuthCode(account.shared_secret); logger.warn('Error in auth: '+account.twoFactorCode); setTimeout(function() { community.login(account, login); }, 5000); return; } process.exit(0); } logger.trace('Sucesfully auth'); account.sessionID = sessionID; account.cookies = cookies; community.getWebApiKey('secrect.com', webApiKey); community.startConfirmationChecker(10000, account.identity_secret); } after 2 ~ 3 days i lost my session, and i use this for new loggin community.on('sessionExpired', function(err) { if (err) { console.log('sessionExpired: '+err); } community.stopConfirmationChecker(); community.login(account, login); console.log('=======New Session========='); }); How I force to lose my session? for testing my code? It's horrible to have to wait 2 ~ 3 daysSorry my english... Quote
Dr. McKay Posted March 16, 2017 Report Posted March 16, 2017 A pretty easy way to invalidate your session: community.setCookies(["steamLogin=invalid", "steamLoginSecure=invalid"]); Quote
nokill_me Posted March 16, 2017 Author Report Posted March 16, 2017 (edited) Thank you so much!!! Edited March 16, 2017 by nokill_me Quote
DevDuck Posted May 1, 2017 Report Posted May 1, 2017 (edited) A pretty easy way to invalidate your session: community.setCookies(["steamLogin=invalid", "steamLoginSecure=invalid"]); Then I set it, I get this error: /node_modules/steamcommunity/index.js:241 self.steamID = new SteamID(cookie.match(/=(\d+)/)[1]); ^ TypeError: Cannot read property '1' of null at /node_modules/steamcommunity/index.js:241:53 at Array.forEach (native) at SteamCommunity.setCookies (/node_modules/steamcommunity/index.js:238:10) at manager.setCookies (/index.js:120:28) at checkDone (/node_modules/steam-tradeoffer-manager/lib/index.js:98:4) at _community.getWebApiKey (/node_modules/steam-tradeoffer-manager/lib/index.js:149:3) at SteamCommunity.<anonymous> (/node_modules/steamcommunity/components/webapi.js:21:4) at Request._callback (/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/node_modules/request/request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/node_modules/request/request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip.<anonymous> (/node_modules/request/request.js:1091:12) at Gunzip.g (events.js:291:16) What am I doing wrong? Edited May 1, 2017 by DevDuck Quote
Dr. McKay Posted May 1, 2017 Report Posted May 1, 2017 Do this instead: community.setCookies(["steamLogin=1||invalid", "steamLoginSecure=1||invalid"]); DevDuck 1 Quote
DevDuck Posted May 1, 2017 Report Posted May 1, 2017 Do this instead: community.setCookies(["steamLogin=1||invalid", "steamLoginSecure=1||invalid"]); Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.