I have my backend deployed on heroku and my frontend deployed on vercel for ssr. Cookies were being set in dev on my local machine.
cors settings:
app.use(
cors({
origin: process.env.CORS_ORIGIN, //my deployed frontend https://kreddit.vercel.app
credentials: true,
})
Heroku uses a proxy so I have this too
app.set("trust proxy", 1);
session settings:
cookie: {
maxAge: 1000 * 60 * 60 * 24 * 365 * 10, // 10 years
httpOnly: true,
secure: __prod__, // cookie only works in https
sameSite: "none", // csrf
domain: __prod__ ? ".kreddit.vercel.app" : undefined,
},
my apollo client settings for frontend:
credentials: "include"
my request and response:
cookies:
The cookie is received but not being set and the cookies storage remains empty. What's going wrong here? Thanks in advance