Skip to content

Cookie chunking for session cookie #1062

@DavidDeSloovere

Description

@DavidDeSloovere

Describe the feature

The session cookie can get big. Too big for the 4093 limit.

Built-in cookie chunking would benefit everyone from having to work around this.

setCookie could look at the length and chunk automatically
getCookie could look at the content of the first cookie, if it indicates chunking (fex. chunks-2) it could join the values together.
deleteCookie should also check for chunks

Workarounds are possible:

  • leave data out of the session (but you might need that data in a lot of places)
  • store data in separate cookie, plain text (because you don't want to bother, but it's not safe)
  • store data in separate cookie, sealed (but now you need to copy the encryption code, manage the same settings)...

Some references:

https://github.com/supabase/auth-helpers/blob/84ef39c4a498a94717660842a20df3d10b86c794/packages/ssr/src/utils/chunker.ts

https://github.com/dotnet/aspnetcore/blob/main/src/Shared/ChunkingCookieManager/ChunkingCookieManager.cs

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions