Logouts after ~60 Minutes

Hello Tobik,

  /**
   * Keep session alive if user's system is active for last 15 min
   * @returns void
   */
  this.keepAlive = function() {
    const idleInterval = 15 * 60; // detection interval in sec: 15 minutes
    browser.idle.queryState(idleInterval).then( async (idleState) => {
      if (idleState === 'active' && this._masterPassword !== null) {
        await UserService.keepSessionAlive(this);
      }
      this.setKeepAliveTimeout();
    });
  };

This is how the code works at moment: it checks every 15 minutes if the browser is idle, using this browser functionality reserved for extensions, which returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.

So if there is no input, the extension will not try to keep the session alive, and will just let it timeout. So if you have a long session default normally you would need to fail several checks to get logged out.

Note also if the browser window is closed (even if the browser application is not closed) you will get logged out right away. Maybe there is an issue when people use multiple windows (as in instead of tabs) and close one, i will need to double check this.

We welcome your tests and feedback to fine tune the behavior.

1 Like