public function destroy($session_id = null)
    {
        if ($session_id) {
            $this->eventsManager->fireEvent('session:destroy', $this, ['session_id' => $session_id]);
            $this->do_destroy($session_id);
        } else {

            $context = $this->_context;

            if (!$context->started) {
                $this->_start();
            }

            $this->eventsManager->fireEvent('session:destroy', $this, ['session_id' => $session_id, 'context' => $context]);

            $context->started = false;
            $context->is_dirty = false;
            $context->session_id = null;
            $context->_SESSION = null;
            $this->do_destroy($context->session_id);

            $params = $this->_cookie_params;
            $this->cookies->delete($this->_name, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
        }
    }