public function hasSessionId() {
        $name = session_name();

        if (ini_get_bool('session.use_cookies'))
            if (isset($_COOKIE[$name]))
                return true;

        if (!ini_get_bool('session.use_only_cookies'))
            if (isset($_REQUEST[$name]))
                return true;

        return false;
    }