I am deploying the backend on a server using a subdomain and the frontend on another subdomain. However, the cookies are not being set for the frontend. I have tried using the domain: '.domain.com'
option to set the cookies, but it is not working. Can anyone help me figure out what the issue might be?
I tried the solutions and still the cookie was not set:
res.cookie('myCookie', 'myValue', { domain: '.example.com' });
res.cookie('myCookie', 'myValue', { domain: '.example.com', path: '/', secure: true });