public function delete($key = null)
    {
        if (!$this->isInitialized()) {
            return false;
        }

        if (!isset($key)) {

            session_unset();

            if (!session_destroy()) {
                throw new RuntimeException('Failed to delete the session');
            }

            return true;
        }

        gplcart_array_unset($_SESSION, $key);
        return true;
    }