Jump to content


Photo
Question

Error: Not Logged In (webLogOn() doesn't work)

node.js node-steamcommunity

  • Please log in to reply
9 replies to this topic

#1 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 28 December 2018 - 03:36 PM

//Logging ON


client.logOn(logOnOptions);

client.on('loggedOn', function (details) {
	if (details.eresult == SteamUser.EResult.OK) {
		client.getPersonas([client.steamID], function (personas) {
			console.log("== Logged in =============")
			console.log('== Name: ' + personas[client.steamID]["player_name"]);
			console.log('== ID64: ' + client.steamID);
			console.log("==========================");
			console.log("");
		});
		client.setPersona(5); //"5": "LookingToTrade" -- https://github.com/DoctorMcKay/node-steam-user/blob/master/enums/EPersonaState.js
		client.gamesPlayed('Accepting Junk and Making Friends');
	} else {
		console.log(details);
		//Do whatever u want to handle the error...
	}
});


client.on('webSession', (sessionid, cookies) => {
	manager.setCookies(cookies);
	community.setCookies(cookies);
});

As soon as the bot starts everythings works fine. After some minutes, every time an offer is received by the bot, I get the "Not Logged In" error.

I set up a cron (after reading a similar thread on this forum), like this:

//Session refresh every 15 minutes


cron.schedule('*/15 * * * *', () => {
	if (client.steamID) {
		client.webLogOn();
	} else {
		client.logOn(logOnOptions);
		console.log('Logged in again using cron');
	}
});

but the "not logged in" error still remains. I also read this topic where Admin says this but at this point I don't understand which session needs to be refreshed and how.

Also calling "sessionExpired" isn't helping because whenever an incoming trade offer gives me the error, bot doesn't try anymore to accept it, even after session is refreshed, so I have to restart it.

manager.on('newOffer', offer => {
	if (offer.partner.getSteamID64() === 'my_stemid_64') {
		offer.accept((err, status) => {
			if (err) {
				console.log(err);
			} else {
				console.log(`Accepted offer from owner. Status: ${status}.`);
			}
		});
	} else {

	if (offer.itemsToGive.length === 0) {

			offer.accept((err, status) => {
				if (err) {
					console.log(err);
				} else {
					console.log(`Donation accepted. Status: ${status}.`);
				}
			});

	} else {
			offer.decline(err => {
				if (err) {
					console.log(err);
				} else {
					console.log('Donation declined (wanted our items).');
				}
			});
	}
}
});

Any help would be appreciated.

 

 

 



#2 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 28 December 2018 - 03:46 PM

This is an example log between different attempts with almost the same code as above:
 
 
[[20:48:09]] [LOG]    == Logged in =============
[[20:48:10]] [LOG]    == Name: BOT
[[20:48:10]] [LOG]    == ID64: 765611.................
[[20:48:10]] [LOG]    ==========================
[[20:48:10]] [LOG]
[[21:00:00]] [LOG]    Already logged in
[[21:06:05]] [LOG]    Error: Not Logged In
    at SteamCommunity.manager._community.httpRequestPost (D:\Portable\Birba\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:483:25)


#3 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 28 December 2018 - 05:31 PM

Also found this: https://dev.doctormc...nged/#entry6149

 

Looks like same (not resolved) issue.



#4 KaMilml

KaMilml

    Member

  • Member
  • PipPip
  • 17 posts

Posted 28 December 2018 - 06:51 PM

same problem.. still have not any solutions :(



#5 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 28 December 2018 - 07:55 PM

Tried once more after adding a new piece of code:

community.on('sessionExpired', function(err) {
	if (err) {
		console.log('Session Expired: ' + err);
	}
	
	if (client.steamID) {
		client.webLogOn();
		console.log('called weblogon: ' + client.steamID);
	} else {
		client.logOn(logOnOptions);
		console.log('called logon');
	}
});

and I got this error:

 

[[01:46:43]] [LOG]    Session Expired: Error: HTTP error 403
[[01:46:43]] [LOG]    called weblogon: 76........
[[01:46:43]] [LOG]    Error: Not Logged In
    at SteamCommunity.manager._community.httpRequestPost (D:\Portable\Birba\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:483:25)
 
 
It repeats every time I send a new offer.


#6 Berlioz

Berlioz

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 29 December 2018 - 07:31 AM

I have same problem.



#7 Riya

Riya

    Newbie

  • Member
  • Pip
  • 6 posts

Posted 29 December 2018 - 03:50 PM

same problem my devloper told me its something of steam issue, what u can do right now is simply restart the whole bot eg when sessionexpired is thrown u can log out completly and login again completely then the bot will work for 15-20 mins and will repeat same if prob continues



#8 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 01 January 2019 - 01:16 AM

i wouldnt understand whats going on, but you basically lose your web session very quickly, and have to add your own logic to retry your web calls after calling webLogOn again when the session expires. It will prolly be sorted in the new version.



#9 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 13 January 2019 - 01:39 PM

This seems to be fixed for me since I switched to Mobile Auth.



#10 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 17 January 2019 - 11:08 AM

Unfortunately it's happening again.

 

[16:37:22] [LOG]
[16:37:22] [LOG]    Bot version: 1.3.2
[16:37:22] [LOG]    node.js version: v8.11.1
[16:37:24] [LOG]
[16:37:24] [LOG]    == Logged in =============
[16:37:24] [LOG]    == Name: ZED
[16:37:24] [LOG]    == ID64: 76561198
[16:37:24] [LOG]    ==========================
[16:37:24] [LOG]
[16:37:29] [LOG]    Accepted offer 3442372810 from owner. Status: pending.
[16:37:33] [LOG]    Offer 3442372810: Confirmed!
[17:00:00] [LOG]    Already logged in: 76561198
[17:00:00] [LOG]    Called weblogon from cron
[17:05:22] [LOG]    Session Expired: Error: HTTP error 403
[17:05:22] [LOG]    called weblogon: 76561198
[17:05:22] [LOG]    Error: Not Logged In
    at SteamCommunity.manager._community.httpRequestPost (/mnt/d/P
ortable/ZED/node_modules/steam-tradeoffer-manager/lib/classes/Trad
eOffer.js:483:25)
    at Request._callback (/mnt/d/Portable/ZED/node_modules/steamco
mmunity/components/http.js:67:15)
    at Request.self.callback (/mnt/d/Portable/ZED/node_modules/req
uest/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/mnt/d/Portable/ZED/node_modules/reque
st/request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/mnt/d/Portable/ZED/node_modul
es/request/request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
 
 
 
This thing is driving me crazy.

Edited by roughnecks, 17 January 2019 - 11:09 AM.






Also tagged with one or more of these keywords: Question, node.js, node-steamcommunity

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users