[PR #5154] [CLOSED] docs: calls out changes to cookie name when the cookie is secure with code sample #5811

Closed
opened 2026-03-13 12:37:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5154
Author: @j23schoen
Created: 10/7/2025
Status: Closed

Base: canaryHead: docs/clarify-secure-cooke-implications


📝 Commits (2)

  • 484a950 docs: calls out changes to cookie name when the cookie is secure with code sample
  • a0387de docs: use callout component, fix up typescript code block errors

📊 Changes

2 files changed (+21 additions, -0 deletions)

View changed files

📝 docs/content/docs/concepts/cookies.mdx (+17 -0)
📝 docs/content/docs/reference/security.mdx (+4 -0)

📄 Description

I made a few tweaks to the docs around cookies and the name of the session cookie. My team shipped something that relied on the cookie name being what it is in local development, only to find that in prod the cookie is secure and prefixed with __Secure-.

I updated the docs in two spots and called this out. I did some local testing to verify the effects that updating the cookie prefix and cookie name had, but the __Secure- persists as long as useSecureCookies is true or you meet the other criteria mentioned for secure cookies.


Summary by cubic

Clarified cookie naming for secure cookies: the session cookie is always prefixed with __Secure- when useSecureCookies is enabled or HTTPS is used, even if you set a custom cookiePrefix.
Updated the cookies and security docs with a note and a code sample showing the resulting name (__Secure-make-believe.session_token).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5154 **Author:** [@j23schoen](https://github.com/j23schoen) **Created:** 10/7/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `docs/clarify-secure-cooke-implications` --- ### 📝 Commits (2) - [`484a950`](https://github.com/better-auth/better-auth/commit/484a950ecfff7770b8b916582237102d49c4962a) docs: calls out changes to cookie name when the cookie is secure with code sample - [`a0387de`](https://github.com/better-auth/better-auth/commit/a0387de1fa70dadc6cfbaff5236647721e24602d) docs: use callout component, fix up typescript code block errors ### 📊 Changes **2 files changed** (+21 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/cookies.mdx` (+17 -0) 📝 `docs/content/docs/reference/security.mdx` (+4 -0) </details> ### 📄 Description I made a few tweaks to the docs around cookies and the name of the session cookie. My team shipped something that relied on the cookie name being what it is in local development, only to find that in prod the cookie is secure and prefixed with `__Secure-`. I updated the docs in two spots and called this out. I did some local testing to verify the effects that updating the cookie prefix and cookie name had, but the `__Secure-` persists as long as `useSecureCookies` is true or you meet the other criteria mentioned for secure cookies. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clarified cookie naming for secure cookies: the session cookie is always prefixed with `__Secure-` when `useSecureCookies` is enabled or HTTPS is used, even if you set a custom `cookiePrefix`. Updated the cookies and security docs with a note and a code sample showing the resulting name (`__Secure-make-believe.session_token`). <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:37:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5811