简体   繁体   中英

Spring boot & react - Cookies are not being set via browser, but are set on postman

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM