I am trying to set cookies, but they are not being set on the browser, but they do when I use postman to call the request.
Both sever & client run on HTTP. I can see the cookies being set in the response of the request in the network tab, but on application tab -> cookies localhost:3000 are not being set.
Thats how I set my cookies:
And that's how I call the request with react:
Why are the cookies not being set? Is there something wrong?
First guess is you are setting cookies to 127.0.0.1
and trying to read them on localhost
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.