Jump to content
McKay Development

Not Logged In after 24 hours and failes to refresh


after

Recommended Posts

hello,

after about 24 hours, maybe little more, my session of the steam-tradeoffer-manager always expires. so when a trade should be sent, it shows the error "Not Logged In", afterwards "sessionExpired" (Error: HTTP error 401)  gets fired and and new cookies will be set with "webSession". looks fine for me. but when a second trade offer should be sent after a few minutes, its always getting the same error: "Not logged in". and everythign happens again. its basically an endless loop which never ends. what im doing wrong?

var client = new SteamUser({
	localAddress: config.ip
})

var community = new SteamCommunity({
	localAddress:config.ip
});

var manager = new TradeOfferManager({
	"steam": client,
	"community": community,
	"domain": "localhost",
	"language": "en",
	"cancelTime": 300000,
	"pendingCancelTime": 120000
});

client.logOn({
	accountName: config.username,
	password: config.password,
	twoFactorCode: SteamTotp.generateAuthCode(twoFactorData.shared_secret)
});

client.on('loggedOn', function() {
	console.log("Logged into Steam");
	client.setPersona(SteamUser.EPersonaState.Online);
	client.requestFreeLicense(config.games, function() {
		client.gamesPlayed(config.games);
	});
});

client.on('webSession', function(sessionID, cookies) {
	console.log('New Session');
	
	manager.setCookies(cookies, function(err) {
		if (err) {
			console.log('webSession: '+err);
			throw err;
		}
	});
	community.setCookies(cookies);
});

community.on('sessionExpired', function(err) {
	if (err) {
		console.log('sessionExpired: '+err);
	}
	
	client.webLogOn();
});
Quote

Logged into Steam
New Session

//everything works well, after maybe 24 hours it starts with the endless loop:

[STEAMID64]
Found 55 CS:GO items
Add item: P2000 | Handgun (Well-Worn)
sessionExpired: Error: HTTP error 401
Trade Offer Send Error: Not Logged In
New Session

[STEAMID64]
Found 55 CS:GO items
Add item: P2000 | Handgun (Well-Worn)
sessionExpired: Error: HTTP error 401
Trade Offer Send Error: Not Logged In
New Session

[STEAMID64]
Found 55 CS:GO items
Add item: P2000 | Handgun (Well-Worn)
sessionExpired: Error: HTTP error 401
Trade Offer Send Error: Not Logged In
New Session

Quote

 

 

Edited by after
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...