public void store(final HttpServletRequest request,
                      final HttpServletResponse response,
                      final String wctx,
                      final Service service,
                      final WsFederationConfiguration configuration) {
        val details = new HashMap<String, Object>();

        details.put(CasProtocolConstants.PARAMETER_SERVICE + '-' + wctx, service);
        val methods = request.getParameter(CasProtocolConstants.PARAMETER_METHOD);
        if (StringUtils.isNotBlank(methods)) {
            details.put(CasProtocolConstants.PARAMETER_METHOD + '-' + wctx, methods);
        }
        val locale = request.getAttribute(casProperties.getLocale().getParamName());
        if (locale != null) {
            details.put(casProperties.getLocale().getParamName() + '-' + wctx, locale);
        }
        val theme = request.getAttribute(casProperties.getTheme().getParamName());
        if (theme != null) {
            details.put(casProperties.getTheme().getParamName() + '-' + wctx, theme);
        }

        val cookieValue = serializeSessionValues(details);
        val cookieGen = configuration.getCookieGenerator();
        LOGGER.debug("Adding WsFederation cookie [{}] with value [{}]", cookieGen.getCookieName(), cookieValue);
        cookieGen.addCookie(request, response, cookieValue);
        Optional.ofNullable(request.getSession(false))
            .ifPresent(session -> session.setAttribute(configuration.getId(), cookieValue));
    }
Store.

@param request       the request
@param response      the response
@param wctx          the wctx
@param service       the service
@param configuration the configuration
support/cas-server-support-wsfederation/src/main/java/org/apereo/cas/support/wsfederation/web/WsFederationCookieManager.java