code: public void logout() {
          if (loginContext != null) {
              try {
                  loginContext.logout();
                  if (logoutLogger.isDebugEnabled()) {
                      logoutLogger.debug("[ws/#" + getId() + "] Logout successful.");
                  }
              } catch (LoginException e) {
                  logoutLogger.trace("[ws/#" + getId() + "] Exception occurred logging out of this WebSocket session.", e);
              }
          }
          loginContext = null;
      }
docs: Log out of the login context associated with this WebSocket session.
  Used to clean up any login context state that should be cleaned up.