[PR #5645] feat: session store chunking #14383

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

Original Pull Request: https://github.com/better-auth/better-auth/pull/5645

State: closed
Merged: Yes


Summary by cubic

Add cookie chunking for session data to support values larger than 4KB and prevent cache failures. Session cookies are split, reassembled on read, and fully cleaned up on sign out.

  • New Features
    • Introduced createSessionStore to chunk large session cookies and set all parts; exported for reuse.
    • setCookieCache now uses the session store; deleteSessionCookie removes all session_data chunks.
    • getCookieCache and the session route reconstruct session_data from chunked cookies if needed.
    • Added tests for chunking, reconstruction, and cleanup.
**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5645 **State:** closed **Merged:** Yes --- <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Add cookie chunking for session data to support values larger than 4KB and prevent cache failures. Session cookies are split, reassembled on read, and fully cleaned up on sign out. - **New Features** - Introduced createSessionStore to chunk large session cookies and set all parts; exported for reuse. - setCookieCache now uses the session store; deleteSessionCookie removes all session_data chunks. - getCookieCache and the session route reconstruct session_data from chunked cookies if needed. - Added tests for chunking, reconstruction, and cleanup. <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:26:54 -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#14383