public function destroy()
    {
        if ($this->getIsActive()) {
            $sessionId = $this->getId();
            return $this->close(true)
                ->otherwise(function() { return true; })
                ->then(function() use ($sessionId) {
                    $this->setId($sessionId);
                    return $this->open();
                });
        }
        return Reaction\Promise\resolve(true);
    }
public function destroy()
    {
        if ($this->getIsActive()) {
            $sessionId = $this->getId();
            return $this->close(true)
                ->otherwise(function() { return true; })
                ->then(function() use ($sessionId) {
                    $this->setId($sessionId);
                    return $this->open();
                });
        }
        return Reaction\Promise\resolve(true);
    }
public function destroy ( ) { if ( $ this -> getIsActive ( ) ) { $ sessionId = $ this -> getId ( ) ; return $ this -> close ( true ) -> otherwise ( function ( ) { return true ; } ) -> then ( function ( ) use ( $ sessionId ) { $ this -> setId ( $ sessionId ) ; return $ this -> open ( ) ; } ) ; } return Reaction \ Promise \ resolve ( true ) ; }
Frees all session variables and destroys all data registered to a session.

This method has no effect when session is not [[getIsActive()|active]].
Make sure to call [[open()]] before calling it.
@see open()
@see isActive
Frees all session variables and destroys all data registered to a session .