Skip to content

Conversation

genius00hwan
Copy link

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.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants