Close the current session
341268
def close(self):
        
        self.active = False
        self.end = utcnow()
        self._model.save()
1272762
def kill_current_session(ctx: Context_T) -> None:
    
    ctx_id = context_id(ctx)
    if ctx_id in _sessions:
        del _sessions[ctx_id]
133986
public synchronized void closeImmediatedly() {

        close();

        Iterator iterator = this.connectionsInUse.iterator();

        while (iterator.hasNext()) {
            PooledConnection connection = (PooledConnection) iterator.next();
            SessionConnectionWrapper sessionWrapper =
                (SessionConnectionWrapper) this.sessionConnectionWrappers.get(
                    connection);

            closeSessionWrapper(
                sessionWrapper,
                "Error closing session wrapper. Connection pool was shutdown immediatedly.");
        }
    }
353537
public static void closeQuietly(final Session session)
    {
        if (session != null) {
            try {
                session.close();
            }
            catch (JMSException je) {
                if (je.getCause() instanceof InterruptedException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedException");
                }
                if (je.getCause() instanceof InterruptedIOException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedIOException");
                }
                else {
                    LOG.warnDebug(je, "While closing session");
                }
            }
        }
    }
69866
def close(self):
        """"""
        uwsgi.disconnect()
        if self._req_ctx is None:
            # better kill it here in case wait() is not called again
            self._select_greenlet.kill()
            self._event.set()
792258
def stop(self, reason=''):
        
        key = '/status/sessions/terminate?sessionId=%s&reason=%s' % (self.session[0].id, quote_plus(reason))
        return self._server.query(key)
709262
public synchronized void close() {
    if (zooKeeper != null) {
      try {
        zooKeeper.close();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        LOG.warning("Interrupted trying to close zooKeeper");
      } finally {
        zooKeeper = null;
        sessionState = null;
      }
    }
  }
1129855
def unlock(self):
    """"""
    if not hasattr(self, 'session'):
      raise RuntimeError('Error detected! The session that you want to close does not exist any more!')
    logger.debug("Closed database session of '%s'" % self._database)
    self.session.close()
    del self.session
265332
def close(self):
        """"""
        if self.connection:
            self.connection.close()
            self.connection = None
            logging.debug("Connection closed.")
879360
def close_session(self):
        

        if self.session_id:
            url = self.build_url(self._endpoints.get('close_session'))
            response = self.con.post(url, headers={'workbook-session-id': self.session_id})
            return bool(response)
        return False
871949
public void close() throws SFException, SnowflakeSQLException
  {
    logger.debug(" public void close()");

    // stop heartbeat for this session
    stopHeartbeatForThisSession();

    if (isClosed)
    {
      return;
    }

    SessionUtil.LoginInput loginInput = new SessionUtil.LoginInput();
    loginInput.setServerUrl(
        (String) connectionPropertiesMap.get(SFSessionProperty.SERVER_URL))
        .setSessionToken(sessionToken)
        .setLoginTimeout(loginTimeout);

    SessionUtil.closeSession(loginInput);
    closeTelemetryClient();
    clientInfo.clear();
    isClosed = true;
  }
19809
def _end_session(self, kill=None):
        """"""
        if self._stc:
            if kill is None:
                kill = os.environ.get('STC_SESSION_TERMINATE_ON_DISCONNECT')
                kill = _is_true(kill)
            self._stc.end_session(kill)
            self._stc = None
1253643
public static function terminate_current() {
        global $DB;

        if (!self::$sessionactive) {
            self::init_empty_session();
            self::$sessionactive = false;
            return;
        }

        try {
            $DB->delete_records('external_tokens', array('sid'=>session_id(), 'tokentype'=>EXTERNAL_TOKEN_EMBEDDED));
        } catch (\Exception $ignored) {
            // Probably install/upgrade - ignore this problem.
        }

        // Initialize variable to pass-by-reference to headers_sent(&$file, &$line).
        $file = null;
        $line = null;
        if (headers_sent($file, $line)) {
            error_log('Cannot terminate session properly - headers were already sent in file: '.$file.' on line '.$line);
        }

        // Write new empty session and make sure the old one is deleted.
        $sid = session_id();
        session_regenerate_id(true);
        $DB->delete_records('sessions', array('sid'=>$sid));
        self::init_empty_session();
        self::add_session_record($_SESSION['USER']->id); // Do not use $USER here because it may not be set up yet.
        session_write_close();
        self::$sessionactive = false;
    }
50778
def end(self):
        
        self._process.shutdown()
        self._roasting = False
        self._roast['date'] = now_date(str=True)
1282672
def close(self):
        
        if self._S is not None:
            # after .close() self._event should never be called
            self._S.close()
            self._S = None
            self._Q.put_nowait(None)
1251340
def close(self):
        """"""
        try:
            if not self.session.closed:
                if self.session._connector_owner:
                    self.session._connector.close()
                self.session._connector = None
        except Exception as e:
            Config.dummy_logger.error("can not close session for: %s" % e)
612638
public synchronized void close()
   {

      if (closed)
      {
         throw new IllegalStateException("Session provider already closed");
      }

      closed = true;

      for (ExtendedSession session : (ExtendedSession[])cache.values().toArray(
         new ExtendedSession[cache.values().size()]))
         session.logout();

      // the cache already empty (logout listener work, see onCloseSession())
      // just to be sure
      cache.clear();
   }