Skip to content

T-087: The docs of the cookie maxAge option say what each value does - #153

Merged
thetutlage merged 1 commit into
9.xfrom
task/T-087
Nov 16, 2026
Merged

thetutlage merged 1 commit into
9.xfrom
task/T-087

Conversation

@fleet-panda

@fleet-panda fleet-panda Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue: #152

Goal

The behaviour of the cookie maxAge option stays as it is (#145): a number is seconds, 0 gives a session cookie, and a negative value expires the cookie at once, which is what clearCookie() uses. The JSDoc and the docs now say what 0 and a negative value do. The docs page no longer says that a number is milliseconds.

Deployment requirements

  • No package needs a release. The JSDoc ships with the next release of @adonisjs/http-server.

Pull requests

Acceptance criteria

  • The JSDoc of maxAge in CookieOptions (src/types/response.ts of http-server) says that a number is seconds, that 0 gives a session cookie, and that a negative value, or clearCookie(), expires the cookie at once. Proof: the diff of src/types/response.ts. Two new tests in tests/cookies/serializer.spec.ts prove the two values: 0 sends no Max-Age, and -1 sends Max-Age=0. npm run quick:test: 670 passed.
  • The maxAge option in content/guides/basics/response.md of v7-docs says the same, and no longer says milliseconds. Proof: the diff, and the screenshot below.
  • The code of the cookie serializer does not change. Proof: git diff origin/9.x -- src/cookies src/helpers.ts src/response.ts prints nothing.

Screenshots

Response guide, "Cookie options", the maxAge option, 1280 px wide:

Response guide, cookie options, maxAge, 1280 px

Context changes

None.

Discovered work

None.

@fleet-panda

fleet-panda Bot commented Nov 16, 2026

Copy link
Copy Markdown
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.

@thetutlage
thetutlage merged commit 8818af6 into 9.x Nov 16, 2026
10 checks passed
@thetutlage
thetutlage deleted the task/T-087 branch November 16, 2026 10:15
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.

1 participant