Jump to content
McKay Development

webSession fires every few seconds


apibot
 Share

Recommended Posts


client.on("webSession", set_cookies)
client.on("loggedOn", online)

  
function online() {
  log("logged on")
}
function set_cookies(cookies) {
  log("cookies set")
  community.setCookies(cookies);
}


24 Oct 14:28:58 - test: logged on
24 Oct 14:28:59 - test: cookies set
24 Oct 14:29:01 - test: cookies set
24 Oct 14:29:04 - test: cookies set
24 Oct 14:29:08 - test: cookies set
24 Oct 14:29:17 - test: cookies set

Link to comment
Share on other sites

On 10/27/2021 at 1:52 PM, Dr. McKay said:

The first argument to the webSession callback is sessionID, not cookies. My guess would be that you have a handler for SteamCommunity's sessionExpired event that calls client.webLogOn(), which it's continually doing because it never receives valid cookies.

that's exactly what it was

Link to comment
Share on other sites

  • 9 months later...

@Dr. McKay I seem to have the same problem. I tried opening new ticket, and it didn't open so im posting it here:
 

module.exports = function(accountDetails, accountSettings, nickname, accountID, games){
    this.client = new SteamUser();
    this.community = new SteamCommunity();
    let csgo = new GlobalOffensive(this.client);

    this.logOnOptions = {
        accountName: accountDetails.login,
        password: accountDetails.password,
        rememberPassword: true,
        machineName: machineName,
        clientOS: 16,
        dontRememberMachine: false,
        rememberPassword: true
    }
    if(accountDetails.sharedSecret) this.logOnOptions.twoFactorCode = SteamTotp.generateAuthCode(accountDetails.sharedSecret);
    this.client.setOption("promptSteamGuardCode", false);
    this.client.setOption("autoRelogin", true);

    this.client.logOn(this.logOnOptions);
    this.client.on('loggedOn', () => { ... });

    this.client.on('webSession', (sessionId, cookies) => {
        log(`webSession found.`, this.login);
        this.community.setCookies(cookies);
        log(`Cookies set.`, this.login);
        if(identitySecret){
            this.community.startConfirmationChecker(10000, accountDetails.identitySecret);
            log(`Confirmation checker started.`, this.login);
        }
    });
}

And all I get is:
 

Quote

03/08/2022 18:17 The M. Idle >> xxx >> Setting account up.
03/08/2022 18:17 The M. Idle >> xxx >> Online status and nickname set.
03/08/2022 18:17 The M. Idle >> xxx >> Idling started.
03/08/2022 18:17 The M. Idle >> xxx >> webSession found.
03/08/2022 18:17 The M. Idle >> xxx >> webSession found.
03/08/2022 18:17 The M. Idle >> xxx >> webSession found.
03/08/2022 18:18 The M. Idle >> xxx >> webSession found.
03/08/2022 18:18 The M. Idle >> xxx >> webSession found.
03/08/2022 18:18 The M. Idle >> xxx >> webSession found.
03/08/2022 18:19 The M. Idle >> xxx >> webSession found.
03/08/2022 18:19 The M. Idle >> xxx >> webSession found.
03/08/2022 18:20 The M. Idle >> xxx >> webSession found.

 

Edited by TheM
wrong code
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...
 Share

×
×
  • Create New...