public static void putWarnCookieIfRequestParameterPresent(final CasCookieBuilder warnCookieGenerator, final RequestContext context) {
        if (warnCookieGenerator != null) {
            LOGGER.trace("Evaluating request to determine if warning cookie should be generated");
            val foundParameter = context.getRequestParameters().contains(CasWebflowConstants.ATTRIBUTE_WARN_ON_REDIRECT);
            if (foundParameter && context.getRequestParameters().getBoolean(CasWebflowConstants.ATTRIBUTE_WARN_ON_REDIRECT)) {
                val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(context);
                val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
                warnCookieGenerator.addCookie(request, response, "true");
            }
        } else {
            LOGGER.trace("No warning cookie generator is defined");
        }
    }
Put warn cookie if request parameter present.

@param warnCookieGenerator the warn cookie generator
@param context             the context
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java