Netlify not setting cookies

Hello guys! I’m trying to use a login based on cookies using React Vite on the frontend (hosted on Netlify) and the backend with express using Railway because I wasn’t able to make it works here on Netlify, on mi localHost the cookie is set perfectly but on deploy it gets me an error on network saying i havent set the sameSite as Show on img 1 here.

On img2 you can see the route and the last img it’s the fetch I’m doing on the front

the site is

and the test credentials are:

Password: 1234

if someone can take a look it would be great! i have try on diferent browser, but nothing change!


Hi @robmrivas , the reason for your problem is quoted below

The issue is because the front end and backend are not on the same domain.
You can try the below to set the cookie to see if it works. Replace with your frontend domain url

const cookieOptions = {
        httpOnly: true,
        magAge: 60 * 60 * 1000
        sameSite: 'None',
        secure: true,
        domain: ''

    res.cookie('accessTokenCookie', accessToken, cookieOptions);
    res.send({ status: 'success'});