diff --git a/website/src/server/utils/getSplitTests.tsx b/website/src/server/utils/getSplitTests.tsx index a8d347da6..70582ea15 100644 --- a/website/src/server/utils/getSplitTests.tsx +++ b/website/src/server/utils/getSplitTests.tsx @@ -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; };