I'm trying to set a cookie from the backend server running at "api.mydomain.com" like this to the frontend running at "mydomain.com".
res.cookie('auth', token, {
domain: 'mydomain.com',
httpOnly: true,
signed: true,
secure: true,
sameSite:'none',
});
res.json({
//response object
});
In the response header of the request, the "Set-Cookie" header is visible, but when I am checking the cookie storage for the frontend running on "mydomain.com" I cannot find the cookie.
Set-Cookie: auth=<...>; Domain=mydomain.com; Path=/; HttpOnly; Secure; SameSite=None
My backend server is running Node.js and the frontend is in React.