Skip to content

docs: clarify ResponseCookie Max-Age behavior according to RFC 6265 - #35216

Closed
genius00hwan wants to merge 1 commit into
spring-projects:mainfrom
genius00hwan:docs/responsecookie-maxage-rfc6265
Closed

docs: clarify ResponseCookie Max-Age behavior according to RFC 6265#35216
genius00hwan wants to merge 1 commit into
spring-projects:mainfrom
genius00hwan:docs/responsecookie-maxage-rfc6265

Conversation

@genius00hwan

Copy link
Copy Markdown

Summary

This PR improves documentation for ResponseCookie#getMaxAge() and ResponseCookieBuilder#maxAge().

Motivation

According to RFC 6265, Section 5.2.2,
a negative Max-Age value means no "Max-Age" attribute is sent, making the cookie a session cookie.
This was not clearly documented, which may cause confusion for developers.

Changes

  • Clarified Max-Age behavior in Javadoc
    • Positive → persistent cookie
    • Zero → immediate expiration (deleted)
    • Negative → session cookie (removed when browser closes)
  • Added explicit RFC reference
  • No functional or behavioral changes

Related Issues

Impact

No functional impact. Documentation update only.

Signed-off-by: genius00hwan <qnfn120@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 18, 2025
@bclozel

bclozel commented Sep 19, 2025

Copy link
Copy Markdown
Member

Thanks for the proposal, but I think the current description is short and to the point.

@bclozel bclozel closed this Sep 19, 2025
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants