public static void configureCookiePath(final HttpServletRequest request, final CasCookieBuilder cookieBuilder) {
        val contextPath = request.getContextPath();
        val cookiePath = StringUtils.isNotBlank(contextPath) ? contextPath + '/' : "/";

        val path = cookieBuilder.getCookiePath();
        if (StringUtils.isBlank(path)) {
            LOGGER.debug("Setting cookie path for cookie [{}] to: [{}]", cookieBuilder.getCookieName(), cookiePath);
            cookieBuilder.setCookiePath(cookiePath);
        } else {
            LOGGER.trace("Cookie domain is [{}] with path [{}] for cookie [{}]",
                cookieBuilder.getCookieDomain(), path, cookieBuilder.getCookieName());
        }
    }
Configure cookie path.

@param request       the request
@param cookieBuilder the cookie builder
core/cas-server-core-cookie-api/src/main/java/org/apereo/cas/web/support/CookieUtils.java