Repository navigation
T-087: The docs of the cookie maxAge option say what each value does - #153
Merged
Merged
Conversation
3 tasks done
Contributor
Author
|
Triage: nothing to do. This pull request has no change since the last triage. The only change of the task is a deploy comment on adonisjs/v7-docs#99. All checks pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #152
Goal
The behaviour of the cookie
maxAgeoption stays as it is (#145): a number is seconds,0gives a session cookie, and a negative value expires the cookie at once, which is whatclearCookie()uses. The JSDoc and the docs now say what0and a negative value do. The docs page no longer says that a number is milliseconds.Deployment requirements
@adonisjs/http-server.Pull requests
Acceptance criteria
maxAgeinCookieOptions(src/types/response.tsofhttp-server) says that a number is seconds, that0gives a session cookie, and that a negative value, orclearCookie(), expires the cookie at once. Proof: the diff ofsrc/types/response.ts. Two new tests intests/cookies/serializer.spec.tsprove the two values:0sends noMax-Age, and-1sendsMax-Age=0.npm run quick:test: 670 passed.maxAgeoption incontent/guides/basics/response.mdofv7-docssays the same, and no longer says milliseconds. Proof: the diff, and the screenshot below.git diff origin/9.x -- src/cookies src/helpers.ts src/response.tsprints nothing.Screenshots
Response guide, "Cookie options", the
maxAgeoption, 1280 px wide:Context changes
None.
Discovered work
None.