Skip to content

docs: correct cookie Secure and SameSite defaults and the cross-site guard - #178

Merged
Bccorb merged 4 commits into
mainfrom
docs/cookie-samesite-defaults
Dec 4, 2026
Merged

Bccorb merged 4 commits into
mainfrom
docs/cookie-samesite-defaults

Conversation

@Bccorb

@Bccorb Bccorb commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #173

The cookie reference said secure is true only under NODE_ENV=production and sameSite is none in production and lax elsewhere. Neither was true. This corrects it, and the other pages that stated the old defaults, against the released adapter code.

Behavior documented

Checked against seamless-auth-server main and the published tags, and seamless-auth-go, seamless-auth-python and seamless-auth-rust at v0.7.0.

  • secure: cookieSecure, default true, independent of NODE_ENV (since @seamless-auth/express 0.9.0).
  • sameSite: cookieSameSite, default lax, independent of cookieSecure. The v0.24 CSRF change (fix(csrf): require Origin to match Host without an allow-list and default to SameSite=Lax seamless-auth-server#283, commit 193298a) shipped in @seamless-auth/core and @seamless-auth/express 0.27.0, @seamless-auth/fastify 0.18.0 and @seamless-auth/nextjs 0.11.0, all on npm. Earlier versions defaulted to none when secure. The pages name these versions.
  • Go, Python and Rust adapters default to Lax from v0.7.0 (previously None, or Lax with insecure cookies).
  • The cross-site guard runs whatever the SameSite setting. Without allowedOrigins, a same-site or metadata-free request carrying an Origin must have an Origin host equal to Host. null origins and unknown Sec-Fetch-Site values are refused.

Pages changed

  • reference/cookies-sessions-tokens.mdx: attribute table covers all three Node adapters, version note, and what a cross-site deployment sets (cookieSameSite: 'none', allowedOrigins).

  • build/server-sdks.mdx: option defaults, and a new Cross-site request guard section replacing the paragraph that said the guard only ran for SameSite=None and allowed everything without an allow-list.

  • build/nextjs.mdx: option defaults.

  • build/go-adapter.mdx, build/python-adapter.mdx, build/rust-adapter.mdx: SameSite and allowed-origins defaults and the guard paragraph.

  • build/go-adapter.mdx: current release, go get target and compatibility table moved from v0.2.0 to v0.7.0, with the v0.7.0 cross-site upgrade note.

  • build/python-adapter.mdx, build/rust-adapter.mdx: current release and compatibility table moved from 0.2.0 to 0.7.0, with the same upgrade note.

  • build/server-sdks.mdx and build/ecosystem.mdx: the Python, Go and Rust adapters are listed at 0.7.0 (the matrix had 0.6.0, the SDKs page 0.2.0).

  • build/ecosystem.mdx compatibility matrix: every npm row and the auth API row brought to the v0.24.3 release (versions and declared ranges read from npm and the API tag). Notes updated for OpenID Provider contract 4 (oidc-provider 0.5.x needs auth API 0.24.0 or later), the SameSite=Lax adapter default, and syslog sinks in 0.24.0. The scaffold table reflects seamless-cli 0.30.4 (templates v0.22.1, auth API image still v0.23.0). npm run check:matrix reports all 18 rows matching.

Release notes for v0.20 and v0.21 are left as they are: they describe those releases.

Checks

npm run lint, npm run typecheck (0 errors) and npm run build pass.

…guard

Cookies default to Secure whatever NODE_ENV is, and to SameSite=Lax from
@seamless-auth/express 0.27.0, fastify 0.18.0, nextjs 0.11.0 and the Go,
Python and Rust adapters v0.7.0. The cross-site guard now runs whatever
the SameSite setting and, without an allow-list, requires the Origin host
to equal Host.
The Go page named v0.2.0 as the current release and install target, the
server SDKs page said the Python, Go and Rust adapters were at 0.2.0, and
the compatibility matrix listed 0.6.0 for all three. Each is at 0.7.0.
Both pages named 0.2.0 as the current release and in their compatibility
tables. Each is at 0.7.0, which also changes the cross-site defaults.
Fourteen rows were behind their latest release. Versions and declared
ranges are read from npm and the auth API v0.24.3 tag. The notes now
cover OpenID Provider contract 4, the SameSite=Lax adapter default and
syslog sinks in 0.24.0, and the scaffold table reflects seamless-cli
0.30.4 and templates v0.22.1.
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.

docs: correct cookie secure and SameSite defaults

1 participant