Skip to content

Commit

Permalink
Reduce cookie chunk size (#671)
Browse files Browse the repository at this point in the history
* Reduce cookie chunk size

* Update with sameSite info
  • Loading branch information
silentworks authored Nov 3, 2023
1 parent 5c02ce3 commit fc8ccfd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-windows-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@supabase/ssr': patch
---

Reduce cookie chunk size
2 changes: 1 addition & 1 deletion packages/ssr/src/utils/chunker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function createChunkRegExp(chunkSize: number) {
return new RegExp('.{1,' + chunkSize + '}', 'g');
}

const MAX_CHUNK_SIZE = 3600;
const MAX_CHUNK_SIZE = 3180;
const MAX_CHUNK_REGEXP = createChunkRegExp(MAX_CHUNK_SIZE);

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/ssr/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { CookieOptions } from '../types';

export const DEFAULT_COOKIE_OPTIONS: CookieOptions = {
path: '/',
maxAge: 60 * 60 * 24 * 365 * 1000,
httpOnly: false
sameSite: 'lax',
maxAge: 60 * 60 * 24 * 365 * 1000
};

0 comments on commit fc8ccfd

Please sign in to comment.