[PR #7592] [MERGED] fix: remove duplicate secondary storage writes from setSessionCookie #15673

Closed
opened 2026-04-13 10:09:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7592
Author: @bytaesu
Created: 1/24/2026
Status: Merged
Merged: 1/25/2026
Merged by: @Bekacru

Base: canaryHead: 2026-01-24/fix/duplicate-secondary-storage-writes


📝 Commits (1)

  • 9b2cd66 fix: remove duplicate secondary storage writes from setSessionCookie

📊 Changes

2 files changed (+52 additions, -17 deletions)

View changed files

📝 packages/better-auth/src/api/routes/update-user.test.ts (+52 -0)
📝 packages/better-auth/src/cookies/index.ts (+0 -17)

📄 Description

Note

It appears to already be handled within the internal adapter, and having the cookie helper function also handle secondary storage goes beyond its responsibility.


Summary by cubic

Removed duplicate secondary storage writes by stopping setSessionCookie from writing. Secondary storage updates now happen only in the internal adapter, so updateUser writes once per session token.

  • Bug Fixes
    • Removed secondaryStorage write from setSessionCookie.
    • Added test to ensure updateUser writes a session token only once.

Written for commit 9b2cd66bb5. 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/7592 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/24/2026 **Status:** ✅ Merged **Merged:** 1/25/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `2026-01-24/fix/duplicate-secondary-storage-writes` --- ### 📝 Commits (1) - [`9b2cd66`](https://github.com/better-auth/better-auth/commit/9b2cd66bb5307d49d206ee420f95f57556a64ff8) fix: remove duplicate secondary storage writes from setSessionCookie ### 📊 Changes **2 files changed** (+52 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/update-user.test.ts` (+52 -0) 📝 `packages/better-auth/src/cookies/index.ts` (+0 -17) </details> ### 📄 Description > [!NOTE] > It appears to already be handled within the internal adapter, and having the cookie helper function also handle secondary storage goes beyond its responsibility. - Closes https://github.com/better-auth/better-auth/issues/7586 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed duplicate secondary storage writes by stopping setSessionCookie from writing. Secondary storage updates now happen only in the internal adapter, so updateUser writes once per session token. - **Bug Fixes** - Removed secondaryStorage write from setSessionCookie. - Added test to ensure updateUser writes a session token only once. <sup>Written for commit 9b2cd66bb5307d49d206ee420f95f57556a64ff8. 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-04-13 10:09:58 -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#15673