Cookies disable doesn't work in Internet Explo

2019-05-06 13:53发布

I have Window 7- 64bit machine, I am using below Javascript code to check cookies enable in IE 11.

     var areCookiesEnabled= function () {
        //check by using navigator
        var cookieEnabledNavigator = (navigator.cookieEnabled) ? true : false;
        //By Setting Test Cookies
        document.cookie = "testcookie";
        var cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
        return (cookieEnabled && cookieEnabledNavigator);
      }

It works when do below setting to disable cookies.

enter image description here

But it doesn't work with below setting to disable cookies.

enter image description here

enter image description here

  • Do I need to update cookies check code?
  • Does the IE 11 in Window 10 make any sense? Is Yes, Then why option is there for other Windows?

Any solution would be appreciated. Thanks

0条回答
登录 后发表回答