[PR #8008] [MERGED] fix(cookie): relax cookie retrieval for getSessionCookie #7684

Closed
opened 2026-03-13 13:45:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8008
Author: @jslno
Created: 2/16/2026
Status: Merged
Merged: 2/16/2026
Merged by: @Bekacru

Base: canaryHead: 02-16-2026/relax-cookie-retrieval


📝 Commits (4)

  • 4c79bad fix(cookie): relax cookie retrieval for getSessionCookie
  • 58d1afb Merge branch 'canary' into 02-16-2026/relax-cookie-retrieval
  • 32aa25c chore: fix linting
  • 8e6378e chore: cleanup

📊 Changes

2 files changed (+38 additions, -12 deletions)

View changed files

📝 packages/better-auth/src/cookies/cookies.test.ts (+31 -1)
📝 packages/better-auth/src/cookies/index.ts (+7 -11)

📄 Description

Fixes #7370


Summary by cubic

Relaxed getSessionCookie to read session tokens using dot or dash separators and auto-detect __Secure- cookies. Keeps existing cookies working and supports custom prefixes and names.

  • Bug Fixes
    • Reads both "prefix.cookieName" and "prefix-cookieName".
    • Auto-detects secure cookies with __Secure- for both forms.
    • Honors custom cookiePrefix and cookieName; default prefix is "better-auth" (no trailing dot).

Written for commit 8e6378e2f4. Summary will update on new commits.


🔄 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/8008 **Author:** [@jslno](https://github.com/jslno) **Created:** 2/16/2026 **Status:** ✅ Merged **Merged:** 2/16/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `02-16-2026/relax-cookie-retrieval` --- ### 📝 Commits (4) - [`4c79bad`](https://github.com/better-auth/better-auth/commit/4c79badad906a11a6878445d1527696a025114fb) fix(cookie): relax cookie retrieval for `getSessionCookie` - [`58d1afb`](https://github.com/better-auth/better-auth/commit/58d1afbcaf1ee0fa71e85419e7bf10df94a27dc3) Merge branch 'canary' into 02-16-2026/relax-cookie-retrieval - [`32aa25c`](https://github.com/better-auth/better-auth/commit/32aa25cb45e46478eb4fdcd6392876f3ae16db71) chore: fix linting - [`8e6378e`](https://github.com/better-auth/better-auth/commit/8e6378e2f4b8799f2dc9f1025d7fc19fb0b2332d) chore: cleanup ### 📊 Changes **2 files changed** (+38 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/cookies/cookies.test.ts` (+31 -1) 📝 `packages/better-auth/src/cookies/index.ts` (+7 -11) </details> ### 📄 Description Fixes #7370 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Relaxed getSessionCookie to read session tokens using dot or dash separators and auto-detect __Secure- cookies. Keeps existing cookies working and supports custom prefixes and names. - **Bug Fixes** - Reads both "prefix.cookieName" and "prefix-cookieName". - Auto-detects secure cookies with __Secure- for both forms. - Honors custom cookiePrefix and cookieName; default prefix is "better-auth" (no trailing dot). <sup>Written for commit 8e6378e2f4b8799f2dc9f1025d7fc19fb0b2332d. Summary will update on new commits.</sup> <!-- 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 13:45:35 -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#7684