2017-01-19 1 views
-1

IE 11에서 아래 스크립트를 사용하여 브라우저 쿠키를 확인하거나 사용할 수없는 이유는 무엇입니까?IE 11에서 브라우저 쿠키가 활성화 또는 비활성화되었는지 확인할 수없는 이유

var browser_cookie = navigator.cookieEnabled; 

모든 활성화 된 IE 브라우저 쿠키를 알아내는 방법이나 설정에 사용할 수 있습니다. 자바 스크립트에서 알아 내고 싶습니다.

해결 하시길 바랍니다.

미리 감사드립니다.

+0

. 자바는 자바 스크립트 – khelwood

+0

미안 해요. 적어 두었다 – spyga

답변

0

제게는 효과가 있습니다.

IE 11 Cookie

하지만 쿠키가 활성화되어 있는지 여부를 감지하는 더 나은 방법을 원한다면, 당신은 코드에서 이것을 시도 할 수 있습니다 : 자바로 자바 스크립트 물건에 태그를하지 마십시오

How to detect that JavaScript and/or Cookies are disabled?

function checkCookie(){ 
    var cookieEnabled = navigator.cookieEnabled; 
    if (!cookieEnabled){ 
     document.cookie = "testcookie"; 
     cookieEnabled = document.cookie.indexOf("testcookie")!=-1; 
    } 
    return cookieEnabled || showCookieFail(); 
} 

function showCookieFail(){ 
    // do something here 
} 


// within a window load,dom ready or something like that place your: 
checkCookie(); 
관련 문제