[PR #6990] [MERGED] fix(expo): improve parseSetCookieHeader #7012

Closed
opened 2026-03-13 13:21:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6990
Author: @bytaesu
Created: 12/24/2025
Status: Merged
Merged: 12/26/2025
Merged by: @himself65

Base: canaryHead: 2025-12-25/fix/expo-cookie-empty-name


📝 Commits (4)

  • 21dc17a fix(expo): should skip cookies empty names
  • 02b1daa fix: improve cookie value and cookie attribute handling
  • 01cbcdd test: add test cases for empty name cookie
  • ec94d64 fix: spell

📊 Changes

2 files changed (+42 additions, -4 deletions)

View changed files

📝 packages/expo/src/client.ts (+13 -4)
📝 packages/expo/test/expo.test.ts (+29 -0)

📄 Description

Related to https://github.com/better-auth/better-auth/issues/6810


Note:
Currently, parseSetCookieHeader already exists in better-auth/cookies, but the Expo plugin defines and uses it separately. I think It should be unified, but since better-auth/cookies also contains server-side utilities, I haven’t touched it for now.


Summary by cubic

Update Expo’s parseSetCookieHeader to skip cookies with empty names, safely handle missing name/value segments, and ignore empty attributes. Prevents invalid cookies from being stored, avoids parsing errors from malformed Set-Cookie headers, and preserves existing session cookies when malformed headers are received.

Written for commit ec94d64f75. Summary will update automatically 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/6990 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 12/24/2025 **Status:** ✅ Merged **Merged:** 12/26/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2025-12-25/fix/expo-cookie-empty-name` --- ### 📝 Commits (4) - [`21dc17a`](https://github.com/better-auth/better-auth/commit/21dc17a3928ace9da82660538ec00910395b4fa6) fix(expo): should skip cookies empty names - [`02b1daa`](https://github.com/better-auth/better-auth/commit/02b1daa9cb741ca34bd75bf9f530ad9b3fe857d4) fix: improve cookie value and cookie attribute handling - [`01cbcdd`](https://github.com/better-auth/better-auth/commit/01cbcddafddec0d8be5abaf37502374339b75963) test: add test cases for empty name cookie - [`ec94d64`](https://github.com/better-auth/better-auth/commit/ec94d64f7543bf9995108956dc206e74a0d7424a) fix: spell ### 📊 Changes **2 files changed** (+42 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/expo/src/client.ts` (+13 -4) 📝 `packages/expo/test/expo.test.ts` (+29 -0) </details> ### 📄 Description Related to https://github.com/better-auth/better-auth/issues/6810 --- **_Note:_** Currently, `parseSetCookieHeader` already exists in `better-auth/cookies`, but the Expo plugin defines and uses it separately. I think It should be unified, but since `better-auth/cookies` also contains server-side utilities, I haven’t touched it for now. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Update Expo’s parseSetCookieHeader to skip cookies with empty names, safely handle missing name/value segments, and ignore empty attributes. Prevents invalid cookies from being stored, avoids parsing errors from malformed Set-Cookie headers, and preserves existing session cookies when malformed headers are received. <sup>Written for commit ec94d64f7543bf9995108956dc206e74a0d7424a. Summary will update automatically 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:21:08 -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#7012