Cannot get cookies when request comes from external source
adrianbienias opened this issue · comments
Adrian Bienias commented
Using cookies-next
on the server side requires passing req, res
.
But that leads to a situation when cookies cannot be get if a request comes from an external source.
Example scenario:
- User is logged in on website A (session cookie is set)
- There's a link to website A on website B
- User clicks that link and is redirected from website B to website A
- User sees that is not logged in anymore on website A (the request doesn't have cookies)
- User clicks a login button but then the website shows that the user is already logged in (a new request came from website A with cookies)
Adrian Bienias commented
My bad. Everything works fine.
The issue was caused by setting sameSite
option.