Kinsi55 Posted December 24, 2023 Report Posted December 24, 2023 (edited) I've recently rewritten an old project from scratch using the latest module versions, I'm encountering a Problem where my bot works fine, however after running for a while (days / weeks) it tends to throw Not Logged In errors and does not recover from this situation. I have had this problem in the old code and implemented a duct tape solution there by listening to `manager._community.on('debug')` and calling `steamUser.webLogOn()` if the log contains "Not Logged In", however obviously this is very hacky and probably not intended. My Setup is as follows: TradeofferManager is passed my own instances of SteamUser and SteamCommunity `steamUser.logOn()` => `steamUser.on("webSession")` => `tradeofferManager.setCookies()` Is there something else that I should listen to besides "webSession" to be notified of new cookies? My Module Versions are: "steamcommunity": "^3.47.1" "steam-tradeoffer-manager": "^2.10.6" "steam-user": "^5.0.4" Thanks Edit: This probably should've been categorized under steam-user sorry, my bad. Edited December 24, 2023 by Kinsi55 Quote
Dr. McKay Posted December 24, 2023 Report Posted December 24, 2023 (edited) Either listen for steamcommunity's sessionExpired event and then call webLogOn(), or set up a timer to call webLogOn() periodically. Hourly works good for me. webSession is the correct way to listen for new cookies. The Steam backend doesn't proactively send you new cookies when your session expires; it's up to you to request new ones. Edited December 24, 2023 by Dr. McKay Kinsi55 1 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.