public static String getMonitorKeyCookieName(FacesContext context, ValueExpression monitorKey) {
        String monitorKeyCookieName = Constants.DOWNLOAD_COOKIE + context.getViewRoot().getViewId();
        monitorKeyCookieName = monitorKeyCookieName.replace('/', '_');
        // #9521 remove file extension like .xhtml or .faces as it violates cookie naming rules
        monitorKeyCookieName = monitorKeyCookieName.substring(0, monitorKeyCookieName.lastIndexOf('.'));
        if (monitorKey != null) {
            String evaluated = monitorKey.getValue(context.getELContext());
            if (LangUtils.isNotBlank(evaluated)) {
                monitorKeyCookieName += "_" + evaluated;
            }
        }
        return monitorKeyCookieName;
    }
Adds the cookie represented by the arguments to the response. If the current HTTP conversation is secured
over SSL (e.g. https:) then the cookie is set to secure=true and sameSite=Strict.

@param context the FacesContext contains the External context we add the cookie to
@param name To be passed as the first argument to the <code>Cookie</code> constructor.
@param value To be passed as the second argument to the <code>Cookie</code> constructor.
@param properties A <code>Map</code> containing key/value pairs to be passed
as arguments to the setter methods as described above.
primefaces/src/main/java/org/primefaces/util/ResourceUtils.java