Skip to content

Set-Cookie to use Max-Age in preference to Expires #1025

@markt-asf

Description

@markt-asf

The HTTP working group has identified that any browser that doesn't have other, bigger, compatibility issues supports Max-Age.

Further, RFC 6265bis has been updated to allow Max-Age=0.

Given this I would like to propose the following changes:

  • update the Cookie Javadoc to state that for maxAge >=0, Max-Age shall always be sent and an equivalent Expires may be sent
  • update the Cookie Javadoc to state that for maxAge <0, neither Max-Age nor expires shall be sent
  • update the TCK to require Max-Age (and to check there is no Expires where none is expected)

Given that RFC 6265 is still in development, do we want to make these changes in Servlet 6.2? They would be strictly in breach of the current RFC 6265 (server should not send Max-Age=0) but the more relaxed client requirements in RFC 6265 do allow Max-Age=0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions