src/SessionInstance.php
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;
    }
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;
    }
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 ; }
Tear down the session and wipe all its data.

@return SessionInterface
Tear down the session and wipe all its data .