blazu.g
blazu.g
RRailway
Created by blazu.g on 4/2/2023 in #✋|help
httpOnly cookies not being set in production using koa
Hi, I'm trying to set httponly cookies in my koajs app but to no avail I have a custom domain in railway server.myapp.com Cookies options:
const domain = config.MY_APP_ENV === 'production' ? 'myapp.com' : undefined;

const options = {
domain,
httpOnly: true,
secure: config.MY_APP_ENV !== 'development',
sameSite: 'lax',
path: '/',
maxAge,
};

context.ctx.cookies.set(COLLECTION_SESSION_COOKIE, token, options);
const domain = config.MY_APP_ENV === 'production' ? 'myapp.com' : undefined;

const options = {
domain,
httpOnly: true,
secure: config.MY_APP_ENV !== 'development',
sameSite: 'lax',
path: '/',
maxAge,
};

context.ctx.cookies.set(COLLECTION_SESSION_COOKIE, token, options);
20 replies