Destroy session.

@return void
168458
public function destroy(): void
    {
        //delete session data
        $this->data = [];
        $this->id = '';

        //destroy cookie
        \setcookie($this->name, 'NothingToSeeHere.', \time());

        //call session destroy
        \session_destroy();

        //update status
        $this->status = \session_status();
    }
216023
public function destroy($reason)
    {

        // check if the session has already been destroyed
        if ($this->getId() != null) {
            // create a new cookie with the session values
            $cookie = new HttpCookie(
                $this->getName(),
                $this->getId(),
                $this->getLifetime(),
                $this->getMaximumAge(),
                $this->getDomain(),
                $this->getPath(),
                $this->isSecure(),
                $this->isHttpOnly()
            );

            // let the cookie expire
            $cookie->expire();

            // and add it to the response
            $this->getResponse()->addCookie($cookie);
        }

        // reset the requested session ID in the request
        $this->getRequest()->setRequestedSessionId(null);

        // destroy the sessions data
        parent::destroy($reason);
    }
805265
public static function destroy()
    {
        if (\session_status() !== PHP_SESSION_ACTIVE) {
            return false;
        }
        foreach (\array_keys($_SESSION) as $key) {
            unset($_SESSION[$key]);
        }
        self::$cfgStatic['id'] = null;
        $success = \session_destroy();
        if (!$success) {
            return false;
        }
        /*
            Clear cookie so new session not automatically started on next page load
            If strict mode is enabled... this isn't exactly necessary...  a new id will be used..
            however, we may not want to start a new session
        */
        \setcookie(
            self::$cfgStatic['name'],
            '',
            \time()-60*60*24,
            self::$cfgStatic['cookiePath'],
            self::$cfgStatic['cookieDomain'],
            self::$cfgStatic['cookieSecure'],
            self::$cfgStatic['cookieHttponly']
        );
        return $success;
    }
936033
private function deleteSessionCookie() {
		$params = \session_get_cookie_params();

		// ask for the session cookie to be deleted (requests a cookie to be written on the client)
		$cookie = new Cookie(\session_name());
		$cookie->setPath($params['path']);
		$cookie->setDomain($params['domain']);
		$cookie->setHttpOnly($params['httponly']);
		$cookie->setSecureOnly($params['secure']);
		$result = $cookie->delete();

		if ($result === false) {
			throw new HeadersAlreadySentError();
		}
	}
485362
public function destroy()
    {
        try {
            $this->dispatch(new PerformUserLogout());
            return redirect($this->config->get('authentication.logout.redirectUri'));
        } catch (SessionHasExpired $e) {
            return redirect()->route('authentication::session.create')->withErrors([
               'authentication::login_warning' => $e->getMessage()
           ]);
        }
    }
128170
public static function destroy($key = '')
    {
        if (self::$_sessionStarted == true) {

            if (empty($key)) {
                session_unset();
                session_destroy();
            } else {
                self::setPrefix();
                unset($_SESSION[self::$_sessionPrefix . $key]);
            }
        }
    }
488569
public function clear()
    {
        if (isset($_SESSION) && isset($_SESSION[self::ID])) {
            $_SESSION[self::ID] = null;
            unset($_SESSION[self::ID]);
        }
    }
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;
    }
537308
public static function kill_all_sessions() {
        global $DB;

        self::terminate_current();

        self::load_handler();
        self::$handler->kill_all_sessions();

        try {
            $DB->delete_records('sessions');
        } catch (\dml_exception $ignored) {
            // Do not show any warnings - might be during upgrade/installation.
        }
    }
838970
function destroy($session_id)
    {

        // deletes the current session id from the database
        $result = $this->_mysql_query('

            DELETE FROM
                ' . $this->table_name . '
            WHERE
                session_id = "' . $this->_mysql_real_escape_string($session_id) . '"

        ') or die($this->_mysql_error());

        // if anything happened
        // return true
        if ($this->_mysql_affected_rows() !== -1) return true;

        // if something went wrong, return false
        return false;

    }
674621
private void destroySession() {
        currentSessionId = 0;
        setAppLaunchPushed(false);
        getConfigLogger().verbose(getAccountId(),"Session destroyed; Session ID is now 0");
        clearSource();
        clearMedium();
        clearCampaign();
        clearWzrkParams();
    }
920246
public function destroy()
    {
        $this->security->destroy();
        $_SESSION = [];
        setcookie(session_name(), '', 1);
        unset($_COOKIE[session_name()]);
        session_destroy();
    }
343085
public function kill_all_sessions() {
        global $DB;
        if (!$this->connection) {
            return;
        }

        $rs = $DB->get_recordset('sessions', array(), 'id DESC', 'id, sid');
        foreach ($rs as $record) {
            $this->handler_destroy($record->sid);
        }
        $rs->close();
    }
274137
public function destroy()
    {
        if ( NULL !== $this->sessionID )
        {
            session_write_close();
        }
        elseif ( NULL === $this->sessionID && $this->strict )
        {
            throw new InvalidSessionException( 'There is no session to close' );
        }
    }
252440
public function do_destroy($session_id)
    {
        $file = $this->_getFileName($session_id);

        if (file_exists($file)) {
            @unlink($file);
        }

        return true;
    }
508609
public function destroy()
	{
		if(!empty($this->children))
		{
			foreach($this->children as $child)
				$child->destroy();
		}
		unset($this->_finder, $this->_parent, $this->model, $this->relation, $this->master, $this->slave, $this->records, $this->children, $this->stats);
	}
963611
def destroy(self):
		
		if self.session_type == 'bash':
			# TODO: does this work/handle already being logged out/logged in deep OK?
			self.logout()
		elif self.session_type == 'vagrant':
			# TODO: does this work/handle already being logged out/logged in deep OK?
			self.logout()