Phalcon\Session\Adapter\Database::destroy PHP Method

destroy() public method

public destroy ( $session_id = null ) : boolean
return boolean
    public function destroy($session_id = null)
    {
        if (!$this->isStarted()) {
            return true;
        }
        if (is_null($session_id)) {
            $session_id = $this->getId();
        }
        $this->_started = false;
        $options = $this->getOptions();
        $result = $this->connection->execute(sprintf('DELETE FROM %s WHERE %s = ?', $this->connection->escapeIdentifier($options['table']), $this->connection->escapeIdentifier($options['column_session_id'])), [$session_id]);
        return $result && session_destroy();
    }