'Browser not saving response cookies
Frond-end: React (react-admin) with Webpack
Back-end: NestJS / Express
I developed 3 routes (login, check and logout) that are beautifully working with Swagger UI, but when I try to use the 'login' route in my login page it doesn't save the cookie in the browser > application > storage > cookies
I'm setting the cookie on the back end with this code:
response.cookie('tk', 'Bearer ' + token, {
domain: hostname, // localhost or 127.0.0.1
path: "/",
expires: oneMonthFromNowDate,
httpOnly: true,
secure: false,
sameSite: true
});
And in the front end I'm receiving a successfull response with the cookie assigned:
But it is not saving in the browser > application > storage > cookies!
Solution 1:[1]
Looks like I was missing some kind of configuration...
Solved using Axios with "credentials: true" option.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gustavo Contreiras |



