-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper handling of max-age and expires for cookies #10564
Proper handling of max-age and expires for cookies #10564
Conversation
Co-Authored-By: Blacksmoke16 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @straight-shoota 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just with a minor comment
spec/std/http/cookie_spec.cr
Outdated
|
||
it "sets future expiration_time with max-age" do | ||
cookie = parse_set_cookie("bla=1; max-age=1") | ||
(cookie.expiration_time.not_nil!).should be > Time.utc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these parentheses necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'll remove them.
Reissue of #7925. I can't add commits to the original PR, so this is a fresh and more focused start.
This patch adds
max_age
andcreation_time
properties toHTTP::Cookie
which allow a more versatile handling of expiration times.Resolves #5033
Closes #7925