Skip to content

docs: document secure, sameSite and __Host- cookie prefix usage - #304

Open
Tony133 wants to merge 1 commit into
mainfrom
docs/cookie-security-options
Open

docs: document secure, sameSite and __Host- cookie prefix usage#304
Tony133 wants to merge 1 commit into
mainfrom
docs/cookie-security-options

Conversation

@Tony133

@Tony133 Tony133 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Proposal:

  • Documents that secure, sameSite, and the __Host- cookie name prefix are already fully supported by @fastify/secure-session — no code changes needed, just missing examples in the README.
  • Follow-up to Considering adding proprietary cookies good practices as Chrome make big changes on cookies in 2024 #209, where these were requested. Turns out the cookie option is passed straight through to @fastify/cookie's setCookie, which already handles secure and sameSite natively, and the __Host- prefix is just a browser-enforced naming convention with no special handling required in either plugin. The functionality was already there, but the README didn't show how to use it.

Changes:

  • Added a bullet in the existing Security section pointing to the new example.
  • Added a new Cookie security options (secure, sameSite, and the __Host- prefix) section with two examples: one combining secure + sameSite, and one showing the __Host- prefix setup (secure: true, path: '/', no domain).

Note:

  • No functional/code changes — documentation only.

@Tony133
Tony133 marked this pull request as ready for review September 2, 2026 08:51
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