Tells the cluster manager to kill the session with a given id
@param sessionId the id of the session to kill
@return 0 in case of success, non zero value on error
@throws IOException
766151
private int killSession(String sessionId)throws IOException {
    try {
      System.out.printf("Killing %s", sessionId);
      ClusterManagerService.Client client = getCMSClient();
      try {
        client.killSession(sessionId);
      } catch (SafeModeException e) {
        throw new IOException(
          "Cannot kill session yet, ClusterManager is in Safe Mode");
      }
      System.err.printf("%s killed", sessionId);
    } catch (TException e) {
      throw new IOException(e);
    }
    return 0;
  }
500716
protected void setIdForRelocate( final String id ) {

        if ( this.id == null ) {
            throw new IllegalStateException( "There's no session id set." );
        }
        if ( this.manager == null ) {
            throw new IllegalStateException( "There's no manager set." );
        }

        /*
         * and mark it as a node-failure-session, so that remove(session) does
         * not try to remove it from memcached... (the session is removed and
         * added when the session id is changed)
         */
        setNote( MemcachedSessionService.NODE_FAILURE, Boolean.TRUE );
        manager.remove( this );
        removeNote( MemcachedSessionService.NODE_FAILURE );
        this.id = id;
        manager.add( this );

    }
1211110
public function destroy($session_id)
	{
		// Get the database connection object and verify its connected.
		if (!$this->connection->connected())
		{
			return false;
		}

		try
		{
			$query = $this->connection->getQuery()
				->delete('#__session')
				->whereEquals('session_id', $session_id);

			// Remove a session from the database.
			$this->connection->setQuery($query->toString());

			return (boolean) $this->connection->execute();
		}
		catch (Exception $e)
		{
			return false;
		}
	}
1022234
public function do_destroy($session_id)
    {
        $redis = is_object($this->_redis) ? $this->_redis : $this->_getRedis();
        $redis->delete($this->_prefix . $session_id);

        return true;
    }
889104
public RefreshSessionResponse refreshSession(String sessionId) {
        RefreshSessionRequest request = new RefreshSessionRequest();
        request.setSessionId(sessionId);
        return refreshSession(request);
    }
655271
static boolean killProcess(final String processName, int id) {
        int pid;
        try {
            pid = processUtils.resolveProcessId(processName, id);
            if(pid > 0) {
                try {
                    Runtime.getRuntime().exec(processUtils.getKillCommand(pid));
                    return true;
                } catch (Throwable t) {
                    ProcessLogger.ROOT_LOGGER.debugf(t, "failed to kill process '%s' with pid '%s'", processName, pid);
                }
            }
        } catch (Throwable t) {
            ProcessLogger.ROOT_LOGGER.debugf(t, "failed to resolve pid of process '%s'", processName);
        }
        return false;
    }
892249
public static Response failure(SessionId sessionId, Throwable reason) {
    Response response = new Response();
    response.setSessionId(sessionId != null ? sessionId.toString() : null);
    response.setValue(reason);
    response.setStatus(ERROR_CODES.toStatusCode(reason));
    response.setState(ERROR_CODES.toState(response.getStatus()));
    return response;
  }
945940
@Override
    public Session newSession(String id) {
        long created = System.currentTimeMillis();
        Session session = sessionCache.newSession(id, created, (defaultMaxIdleSecs > 0 ? defaultMaxIdleSecs * 1000L : -1));
        try {
            sessionCache.put(id, session);
            sessionsCreatedStats.increment();

            for (SessionListener listener : sessionListeners) {
                listener.sessionCreated(session);
            }

            return session;
        } catch (Exception e) {
            log.warn("Failed to create a new session", e);
            return null;
        }
    }
597763
@Override
    public Session delete(String id) throws Exception {
        // get the session, if its not in memory, this will load it
        Session session = get(id);

        // Always delete it from the backing data store
        if (sessionDataStore != null) {
            boolean deleted = sessionDataStore.delete(id);
            if (log.isDebugEnabled()) {
                log.debug("Session " + id + " deleted in db: " + deleted);
            }
        }

        // delete it from the session object store
        if (session != null) {
            session.stopInactivityTimer();
            session.setResident(false);
        }

        return doDelete(id);
    }
886122
public static base_response kill(nitro_service client, systemsession resource) throws Exception {
		systemsession killresource = new systemsession();
		killresource.sid = resource.sid;
		killresource.all = resource.all;
		return killresource.perform_operation(client,"kill");
	}
749474
public function destroy(/*# string */ $session_id)/*# : bool */
    {
        $file = $this->getSessionFile($session_id);
        return $this->storage->del($file);
    }
592713
public function destroy($sessionID): bool
    {
        $where = ['session_id' => $sessionID];
        $query = $this->dbClass->prepare()->delete()->from($this->dbTable)->where($where);
        $result = $this->dbClass->execute($query) == 1 ? true : false;

        return $result;
    }
424092
public static Session getSession(int dbId, long sessionId) {

        Database db = (Database) databaseIDMap.get(dbId);

        return db == null ? null
                          : db.sessionManager.getSession(sessionId);
    }
937785
public function destroy($session_id)
	{
		$key = $this->key($session_id);

		$this->engine->delete($key . '_expire');

		return $this->engine->delete($key);
	}
846184
public void document_id_DELETE(String id) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		exec(qPath, "DELETE", sb.toString(), null);
	}
79292
public function destroy( $sessionId )
    {
        ezpEvent::getInstance()->notify( 'session/destroy', array( $sessionId ) );

        $db = eZDB::instance();
        $escKey = $db->escapeString( $sessionId );

        eZSession::triggerCallback( 'destroy_pre', array( $db, $sessionId, $escKey ) );
        $db->query( "DELETE FROM ezsession WHERE session_key='$escKey'" );
        eZSession::triggerCallback( 'destroy_post', array( $db, $sessionId, $escKey ) );

        return true;
    }
1088858
public void createSession(String sessionId) {
        boolean newSession = sessionId == null;
        sessionId = newSession ? newSessionId() : sessionId;
        SessionController controller = sessions.get(sessionId);
        
        if (controller == null) {
            controller = SessionController.create(sessionId, newSession);
            sessions.put(sessionId, controller);
        }
    }