code: private void setState(State state) {
      if (this.state != state) {
        this.state = state;
        log.debug("State changed: {}", state);
      }
    }
docs: Updates the session state.
  
  @param state The session state.