크로스도메인 withCredentials 관련

황제낙엽 2020.07.29 14:04 조회 수 : 542

sitelink1 http://www.w3.org/TR/XMLHttpRequest/#the...-attribute 
sitelink2  
sitelink3  
sitelink4  
extra_vars4  
extra_vars5  
extra_vars6  

- 동기(synchronous) ajax 호출시 withCredentials을 true로 설정하면 InvalidAccessError가 발생

- async옵션을 true로 하거나 withCredentials 설정을 false로 하면 정상 동작

- widthCredentials를 제거하면 서버에서 cookies, HTTP authentication, and client-side SSL certificates을 읽지 못함

- Cors 요청은 기본적으로 Non-Credential 요청, 따라서 HTTP Cookie와 HTTP Authentication 정보를 인지 못함

    -> 그래서 서버페이지에서 credential 을 true하면 문제가 해결된다

    -> response.setHeader("Access-Control-Allow-Credentials", "true");

        또는 <param-name>cors.support.credentials</param-name><param-value>true</param-value>

번호 제목 글쓴이 날짜 조회 수
206 [GitHub] JavaScript Algorithms and Data Structures (알고리즘과 자료구조) file 황제낙엽 2021.03.01 595
205 콜백지옥과 비동기제어 file 황제낙엽 2021.02.18 1590
204 Json 특징 및 문법 황제낙엽 2021.01.26 522
203 비동기프로그래밍 - 콜백함수(Callback function) file 황제낙엽 2020.08.26 681
202 Strict 모드 황제낙엽 2020.08.23 627
201 window.postMessage() 황제낙엽 2020.07.29 2114
» withCredentials 관련 황제낙엽 2020.07.29 542
199 CORS 관련 레퍼런스 URL 황제낙엽 2020.07.10 590
198 ECMA 스크립트의 JSON 황제낙엽 2019.10.16 580
197 경과 시간 구하기 황제낙엽 2019.10.04 1673
196 입력받은 날짜와 현재 날짜와의 비교 함수 황제낙엽 2019.08.02 1049
195 사용자 모듈 만들기 황제낙엽 2019.07.09 42275
194 charcode 32와 160 차이 (javascript char 160 to 32) 황제낙엽 2019.05.11 580
193 UTF-8 한글 초성 추출 (자바스크립트) 황제낙엽 2019.05.07 750
192 IE브라우저에서 서버의 XML파일을 ajax로 가져와 DOM파싱하는 예제 (XMLHttpRequest, XML, ActiveXObject) 황제낙엽 2018.11.23 652
191 XMLHttpRequest.timeout 황제낙엽 2018.11.03 779
190 부동소수점 (floating-point) file 황제낙엽 2018.03.26 1626
189 User Agent Parser들 황제낙엽 2017.11.20 6204
188 window.postMessage 이해하기 file 황제낙엽 2017.10.16 1904
187 브라우저의 새로고침과 종료에 대한 이벤트 황제낙엽 2017.08.11 3327