private static CookieGenerationContext.CookieGenerationContextBuilder buildCookieGenerationContextBuilder(
        final CookieProperties cookie) {

        return CookieGenerationContext.builder()
            .name(cookie.getName())
            .path(cookie.getPath())
            .maxAge(getCookieMaxAge(cookie.getMaxAge()))
            .secure(cookie.isSecure())
            .domain(cookie.getDomain())
            .sameSitePolicy(cookie.getSameSitePolicy())
            .httpOnly(cookie.isHttpOnly());
    }
Gets cookie max age.

@param maxAge the max age
@return the cookie max age
core/cas-server-core-cookie-api/src/main/java/org/apereo/cas/web/support/CookieUtils.java