private function warnInsecureSettings(): void
    {
        if (!self::$warnInsecureSettings) {
            return;
        }

        if (!ini_get('session.use_cookies')) {
            $errorMessage = 'The ini setting session.use_cookies should be set to true.';
            throw new InsecureSettingsException($errorMessage);
        }

        if (!ini_get('session.use_only_cookies')) {
            $errorMessage = 'The ini setting session.use_only_cookies should be set to true.';
            throw new InsecureSettingsException($errorMessage);
        }

        if (ini_get('session.use_trans_sid')) {
            $errorMessage = 'The ini setting session.use_trans_id should be set to false.';
            throw new InsecureSettingsException($errorMessage);
        }

        if (!ini_get('session.use_strict_mode')) {
            $errorMessage = 'The ini setting session.use_strict_mode should be set to true.';
            throw new InsecureSettingsException($errorMessage);
        }
    }