Skip to content

Commit

Permalink
change cookie to 5 days
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano authored and vitoUwu committed Nov 26, 2024
1 parent ae85730 commit 8c0b7cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blocks/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const matcherBlock: Block<
result ??= isMatchFromCookie ?? matcherFunc(ctx);
if (result !== isMatchFromCookie) {
const date = new Date();
date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000)); // 1 month
date.setTime(date.getTime() + (5 * 24 * 60 * 60 * 1000)); // 5 days
setCookie(respHeaders, {
name: cookieName,
value: cookieValue.build(uniqueId, result),
Expand Down
2 changes: 1 addition & 1 deletion runtime/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export const middlewareFor = <TAppManifest extends AppManifest = AppManifest>(

if (hasFlags && cookieSegment !== value) {
const date = new Date();
date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000)); // 1 month
date.setTime(date.getTime() + (5 * 24 * 60 * 60 * 1000)); // 5 days
setCookie(newHeaders, {
name: DECO_SEGMENT,
value,
Expand Down

0 comments on commit 8c0b7cd

Please sign in to comment.