Recently I deployed my Nest JS backend on domain: name.herokuapp.com and Next JS frontend on domain: name.vercel.app. In both cases names are equal. Backend set cookies successfully, but in different cookie folder - name.herokuapp.com. But I want that this cookies are located in folder name.vercel.app, so i can attach them in my getServerSideProps function. My backend code:
res.cookie('accessToken', at, {
sameSite: 'none',
secure: true,
httpOnly: false,
path: '/',
});
I want, that all cookies are located in name.vercel.app folder.
So, there is an answer. This is impossible. That's it. But you can solve this issue this way:
Hope, this helps)