Http requests withCredentials what is this and why using it?
Short answer: withCredentials() makes your browser include cookies and authentication headers in your XHR request. If your service depends on any cookie (including session cookies), it will only work with this option set.
参考资料:

浙公网安备 33010602011771号