🖥️프론트엔드/HTML | CSS | JAVASCRIPT
자바스크립트 - XMLHttpRequest 쿠키 값도 함께 보내기
Janger
2021. 11. 17. 09:02
728x90
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
XMLHttpRequest.withCredentials - Web APIs | MDN
The XMLHttpRequest.withCredentials property is a boolean value that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. Setting withCredentials has
developer.mozilla.org
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://example.com/', true);
xhr.withCredentials = true;
xhr.send(null);
xhr.withCredentials = true;
send 하기 이전에, 위의 한 줄을 추가해주시면 됩니다.
728x90