Skip to content

fix: year check#230

Closed
pixel365 wants to merge 1 commit intorwf2:masterfrom
pixel365:expires
Closed

fix: year check#230
pixel365 wants to merge 1 commit intorwf2:masterfrom
pixel365:expires

Conversation

@pixel365
Copy link
Copy Markdown
Contributor

RFC 6265, Page 15

@SergioBenitez
Copy link
Copy Markdown
Member

I don't think we should do this, at least not this way, as doing so would mean we fail to parse the entire cookie if the date is < 1601, which would violate the spec (only the expires / date field should fail to parse).

The question of whether the date should or shouldn't parse if the year is < 1601 is a tricky one. Obviously according to the spec, it should fail to parse. Chrome, however, allows it and returns a "minimal time". Firefox accepts it. The jshttp/cookie library also parses it just fine (using the browser's Date). In short, we'd be doing something quite different from the norm, and I suspect we'd break a few things.

The fix to offset is correct, however.

@SergioBenitez
Copy link
Copy Markdown
Member

Correct fixes merged in ff615ab.

@pixel365 pixel365 deleted the expires branch April 17, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants