Closes the current session as well as clearing the token cache.
13516
protected final void closeSessionAndClearTokenInformation() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getOpenSession();
            if (currentSession != null) {
                currentSession.closeAndClearTokenInformation();
            }
        }
    }
805733
protected void onSessionClose(SessionImpl session) {
        Lock lock = lockManager.getLock(getLockingKey(session.keyspace()));
        lock.lock();
        try {
            if (keyspaceCacheMap.containsKey(session.keyspace())) {
                KeyspaceCacheContainer cacheContainer = keyspaceCacheMap.get(session.keyspace());
                cacheContainer.removeSessionReference(session);
                // If there are no more sessions associated to current keyspace,
                // close graph and remove reference from cache.
                if (cacheContainer.referenceCount() == 0) {
                    JanusGraph graph = cacheContainer.graph();
                    graph.close();
                    keyspaceCacheMap.remove(session.keyspace());
                }
            }
        } finally {
            lock.unlock();
        }
    }
674621
private void destroySession() {
        currentSessionId = 0;
        setAppLaunchPushed(false);
        getConfigLogger().verbose(getAccountId(),"Session destroyed; Session ID is now 0");
        clearSource();
        clearMedium();
        clearCampaign();
        clearWzrkParams();
    }
918041
public void shutdown() {
        // Delete the cookie _session if there is one
        Response response = executeToResponse(Http.DELETE(new URIBase(clientUri).path("_session")
                .build()));
        if (!response.isOk()) {
            log.warning("Error deleting session on client shutdown.");
        }
        // The execute method handles non-2xx response codes by throwing a CouchDbException.

        factory.shutdown();
    }
532939
public void close() 
    {
        forwardEngine.close();
        if (forwardEngine != reverseEngine)
            reverseEngine.close();

        Iterator<Map.Entry<Long, SRTCPCryptoContext>> iter
            = contexts.entrySet().iterator();

        while (iter.hasNext()) 
        {
            Map.Entry<Long, SRTCPCryptoContext> entry = iter.next();
            SRTCPCryptoContext context = entry.getValue();

            iter.remove();
            if (context != null)
                context.close();
        }
    }
1217169
public void closeSession(PrimaryBackupSession session) {
    if (sessions.remove(session.sessionId().id()) != null) {
      session.close();
      listeners.forEach(l -> l.onClose(session));
    }
  }
1242788
function close()
    {
        foreach ($this->cache as $key => $data) {
            // The key has been used
            if ($this->cache_changes[$key]) {
                // Make sure we're not going to write unchanged data
                // by comparing current md5 sum with the sum calculated on DB read
                $data = $this->serialize($data);

                if (!$this->cache_sums[$key] || $this->cache_sums[$key] != md5($data)) {
                    $this->write_record($key, $data);
                }
            }
        }

        if ($this->index_changed) {
            $this->write_index();
        }

        // reset internal cache index, thanks to this we can force index reload
        $this->index         = null;
        $this->index_changed = false;
        $this->cache         = array();
        $this->cache_sums    = array();
        $this->cache_changes = array();
    }
756562
public void closeSession(long sessionId) {
    PrimaryBackupSession session = sessions.remove(sessionId);
    if (session != null) {
      log.debug("Closing session {}", session.sessionId());
      session.close();
      service.close(session.sessionId());
    }
  }
889100
public function destroy()
    {
        if (empty($this->sessionToken)) return;

        $this->userData = array();

        $this->handler->destroy($this->sessionToken);

        setcookie($this->sessionCookieName, null, $this->sessionExpiration, '/');

        $this->sessionToken = NULL;
    }
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;
  }
984326
public function clearSessionTokens()
    {
        $this->session->remove(self::SESSION_TOKEN_KEY);
        $this->session->remove(self::SESSION_TOKEN_SECRET_KEY);
    }
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.");
        }
    }
1193674
public void close() {
    synchronized (lock) {
      while (!available.isEmpty()) {
        PooledConnection pci = available.pop();
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      available = null;
      while (!used.isEmpty()) {
        PooledConnection pci = used.pop();
        pci.removeConnectionEventListener(connectionEventListener);
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      used = null;
    }
    removeStoredDataSource();
  }
1362814
def close(self) -> None:
        """"""
        if self.session_id is not None:
            self.client.delete_session(self.session_id)
        self.client.close()
927741
public void closeSession(long index, long timestamp, RaftSession session, boolean expired) {
    log.debug("Closing session {}", session.sessionId());

    // Update the session's timestamp to prevent it from being expired.
    session.setLastUpdated(timestamp);

    // Update the state machine index/timestamp.
    tick(index, timestamp);

    // Expire sessions that have timed out.
    expireSessions(currentTimestamp);

    // Remove the session from the sessions list.
    if (expired) {
      session = sessions.removeSession(session.sessionId());
      if (session != null) {
        session.expire();
        service.expire(session.sessionId());
      }
    } else {
      session = sessions.removeSession(session.sessionId());
      if (session != null) {
        session.close();
        service.close(session.sessionId());
      }
    }

    // Commit the index, causing events to be sent to clients if necessary.
    commit();
  }
930459
public void endSession() {
		if (replayWindow != null) {
			replayWindow.removeAllElements();
		}
		replayWindow = null;
		txEncryptorSuite = rxEncryptorSuite = null;
		txIV = rxIV = null;
		txEncOut = rxEncOut = null;
		txHMAC = rxHMAC = null;
		txSessEncKey = null;
		txSessAuthKey = null;
		txSessSaltKey = null;
		rxSessEncKey = null;
		rxSessAuthKey = null;
		rxSessSaltKey = null;
		firstRtpSeq = 1;
		rollOverCounter = 0;
	}
861433
def close
      return if @session.nil?
      begin
        @session.terminate_session
      rescue Exception => e
        logger.error("Session termination unsuccessful - #{e.message}")
      end
      # clear the cache
      clear
      logger.info("Disconnected from application server.")
      @session = nil
    end