Skip to content

Commit

Permalink
fix(website): use proper secured settings for snack-values cookie (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Aug 1, 2024
1 parent 6b99393 commit a60fe54
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion website/src/server/utils/getSplitTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export default async (ctx: Context) => {
...existingSettings,
};

ctx.res.setHeader('Set-Cookie', cookie.serialize(SNACK_COOKIE_NAME, JSON.stringify(newValues)));
ctx.res.setHeader(
'Set-Cookie',
cookie.serialize(SNACK_COOKIE_NAME, JSON.stringify(newValues), {
httpOnly: true,
secure: process.env.NODE_ENV === 'production',
sameSite: 'strict',
})
);
return newValues;
};

0 comments on commit a60fe54

Please sign in to comment.