protected void autoConfigureCookiePath(final HttpServletRequest request) {
        val casProperties = configurationContext.getCasProperties();
        val core = casProperties.getAuthn().getSamlIdp().getCore();
        val sessionStorageType = core.getSessionStorageType();
        if (sessionStorageType.isTicketRegistry()
            && core.getSessionReplication().getCookie().isAutoConfigureCookiePath()) {
            val cookieBuilder = configurationContext.getSamlDistributedSessionCookieGenerator();
            CookieUtils.configureCookiePath(request, cookieBuilder);
        }
    }
Handle SAML2 exceptions.

@param req the req
@param ex  the ex
@return the model and view
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/AbstractSamlIdPProfileHandlerController.java