protected void rememberSelectedClientIfNecessary(final JEEContext webContext, final Client client) {
        val cookieProps = configContext.getCasProperties().getAuthn().getPac4j().getCookie();
        if (cookieProps.isEnabled()) {
            val cookieBuilder = configContext.getDelegatedClientCookieGenerator();
            if (cookieProps.isAutoConfigureCookiePath()) {
                CookieUtils.configureCookiePath(webContext.getNativeRequest(), cookieBuilder);
            }
            cookieBuilder.addCookie(webContext.getNativeRequest(), webContext.getNativeResponse(), client.getName());
        }
    }
This is {@link DefaultDelegatedClientAuthenticationWebflowManager}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/web/flow/DefaultDelegatedClientAuthenticationWebflowManager.java