Destroy given session.

@param \Cortex\Auth\Models\Session $session

@throws \Exception

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
182591
public function destroy(Session $session)
    {
        $session->delete();

        return intend([
            'back' => true,
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/auth::common.session'), 'identifier' => $session->getKey()])],
        ]);
    }
781621
public function destroy($reason = null)
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034663);
        }
        $this->data = [];
        $this->started = false;
    }
394010
public function destroy()
    {
        session_start();

        if(ini_get("session.use_cookies"))
        {
            $params = session_get_cookie_params();
            setcookie(session_name(),
                      '',
                      time() - 42000,
                      $params["path"],
                      $params["domain"],
                      $params["secure"],
                      $params["httponly"]
            );
        }

        session_unset();
        session_regenerate_id(true);
        session_destroy();
        session_write_close();
    }
9209
public function destroyRegisteredSsoClientSessions(SessionInterface $session) {
		if (!$session->isStarted()) {
			return;
		}

		$ssoClients = $this->getRegisteredSsoClients($session);
		$sessionId = $session->getId();

		$ssoServer = $this->ssoServerFactory->create();
		$this->ssoClientNotifier->destroySession($ssoServer, $sessionId, $ssoClients);
	}
126651
public function destroy($id)
    {
        $status = $this->where('session_id', '=', $id)->trash();

        return $status ? true : false;
    }
578834
public function destroySession(SsoServer $ssoServer, $sessionId, array $ssoClients) {
		foreach ($ssoClients as $ssoClient) {
			/** @var \Flowpack\SingleSignOn\Server\Domain\Model\SsoClient $ssoClient */
			$ssoClient->destroySession($ssoServer, $sessionId);
			$this->ssoLogger->log('Destroyed session "' . $sessionId . '" on client ' . $ssoClient->getServiceBaseUri(), LOG_INFO);
		}
	}
1293759
protected function expired(?Session $session)
    {
        if ($session === null) {
            return false;
        }

        if ($session->updated_at === null) {
            return false;
        }

        return Carbon::now()->diffInMinutes($session->updated_at) > $this->config->get('session.lifetime', 120);
    }
1052325
public function destroy()
    {
        parent::destroy();

     Logger::get()->debug('Destroying user ' . $this->id);
        // If this user is the one stored in the session, destroy that too.
        if (!empty($_SESSION) && ($_SESSION['current_user'] == $this)) {
            unset($_SESSION['current_user']);
        }
    }
183752
public function destroy()
    {
        $_SESSION = [];
        
        if ($this->cookieJar) {
            $this->cookieJar->remove($this->name());
        } else {
            $params = session_get_cookie_params();
            setcookie($this->name(), '', time() - 42000,
                $params["path"], $params["domain"],
                $params["secure"], $params["httponly"]
            );
        }
        
        session_destroy();
    }
920246
public function destroy()
    {
        $this->security->destroy();
        $_SESSION = [];
        setcookie(session_name(), '', 1);
        unset($_COOKIE[session_name()]);
        session_destroy();
    }
1255843
public function destroy() {
        if ($this->getId()) {
            // Clear all session variables
            $_SESSION = array();

            // Delete session cookie
            if (ini_get("session.use_cookies")) {
                $params = session_get_cookie_params();
                setcookie($this->getName(), '', time() - 42000,
                    $params["path"], $params["domain"],
                    $params["secure"], $params["httponly"]
                );
            }

            // Destroy session
            $this->destroySession();
        }
    }
177395
public function destroySession()
    {
        if ($this->_is_session_initialized) {
            $_SESSION = array();
            if (isset($_COOKIE[$this->name])) {
                setcookie($this->name/*session_name()*/, '', time() - 42000, '/');
            }
            session_destroy();
            $this->_is_session_initialized = false;
        }
    }
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;
    }
538189
public function destroy($id)
    {
        try {
            $this->content->destroy($id);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.delete', ['object' => trans('soda::terminology.content')]));
        }

        return redirect()->back()->with('info', trans('soda::messages.deleted', ['object' => trans('soda::terminology.content')]));
    }
337217
public function revokeSessions($username, $session = '')
    {
        $this->username = $username;
        if ($session == '') {
            $newSessions = [];
        } else {
            $sessions = $this->getMeta()->sessions;

            $newSessions = [];
            foreach ($sessions as $s) {
                if ($s['sid'] != $session) {
                    $newSessions[] = $s;
                }
            }
        }

        $this->getMeta()->sessions = $newSessions;
        $this->getMeta()->save();
    }
860112
public function destroy()
	{
		// do we have something to destroy?
		if ( ! empty($this->keys))
		{
			// delete the key from the redis server
			$this->redis->del($this->keys['session_id']);
		}

		parent::destroy();

		return $this;
	}
89320
public function destroy(): SessionInterface
    {
        $this->init();

        # Start the session up, but ignore the error about headers already being sent
        @session_start();

        # Clear the session data from the server
        session_destroy();

        # Clear the cookie so the client knows the session is gone
        setcookie($this->name, "", time() - 86400, $this->cookie->getPath(), $this->cookie->getDomain(), $this->cookie->isSecure(), $this->cookie->isHttpOnly());

        # Reset the session data
        $this->init = false;
        $this->data = [];

        return $this;
    }