diff --git a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java index b5e14851301f..6057b1c847d4 100644 --- a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java +++ b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java @@ -79,12 +79,18 @@ private ResponseCookie(String name, @Nullable String value, Duration maxAge, @Nu /** - * Return the cookie "Max-Age" attribute in seconds. - *
A positive value indicates when the cookie expires relative to the - * current time. A value of 0 means the cookie should expire immediately. - * A negative value means no "Max-Age" attribute in which case the cookie - * is removed when the browser is closed. + * Return the cookie "Max-Age" attribute. + *
+ *
See RFC 6265, Section 5.2.2. */ + public Duration getMaxAge() { return this.maxAge; } @@ -268,11 +274,15 @@ public interface ResponseCookieBuilder { /** * Set the cookie "Max-Age" attribute. + *
+ *
A positive value indicates when the cookie should expire relative - * to the current time. A value of 0 means the cookie should expire - * immediately. A negative value results in no "Max-Age" attribute in - * which case the cookie is removed when the browser is closed. + *
See RFC 6265, Section 5.2.2. */ ResponseCookieBuilder maxAge(Duration maxAge);