是带 cookie 的跨域请求吗?按 MDN 文档正确设置即可。关键在于发送时设置: jsxhr.withCredentials = true; 然后服务器返回要有头: Access-Control-Allow-Origin: http://foo.example Access-Control-Allow-Credentials: true 其中域名那里不能用星号!
是带 cookie 的跨域请求吗?按 MDN 文档正确设置即可。关键在于发送时设置:
然后服务器返回要有头:
其中域名那里不能用星号!