Axios request cannot carry cookie, each login creates a new session,
according to the instructions given online, a withCredent=true, is added as follows:
:
but still can"t get cookie, to ask for help, the kind of urgent
Axios request cannot carry cookie, each login creates a new session,
according to the instructions given online, a withCredent=true, is added as follows:
:
but still can"t get cookie, to ask for help, the kind of urgent
is cookie set on the backend
is the domain name requested at the front end the same as the domain of cookie? if it is different, it will not automatically take cookie
I have solved the problem of. My problem is nginx. Add proxy_cookie_domain domino_server nginx_server to the nginx configuration and the cookie will work.
what does it mean that the backend does not get cookie
first, whether the backend does not return cookie
, or axios
sends without cookie
, check Network
or document.cookie
Because at present, there is no problem from your axios
configuration.
I don't know if the landlord has solved it. I happen to encounter this problem. I don't know if the landlord has used mockjs,. If I turn off mockjs, I can bring the cookie, problem to solve
add the content-type attribute to ajax. The value is one of the following:
application/x-www-form-urlencoded, multipart/form-data, text/plain
using fetch will automatically carry cookie
set withCredentials to true is set to native XML this field is set to true, then cross-domain will certainly carry cookie if the configuration is correct. Take a look at the screenshot requested on
has the landlord solved it? I have also encountered
https://github.com/PanJiaChen.
there is no problem with the setting from the screenshot, excluding the introduction of mockJS and other situations. You can try to use firefix to send a request to see if you have cookie;. Chrome67 introduces a new feature: site-isolation (site isolation), that is, when requesting third-party site data, sensitive information such as cookie is hidden and displayed as "Provisional headers are shown"
.Previous: Php calculates how many weekends there are in a month.
Next: Native js dynamic generation html initialization is inserted into body (id/class is not specified)