4

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

8
  • Duplicate still valid - yes you need debug your code for setting it and reading it again
    – mplungjan
    Sep 29, 2016 at 12:14
  • I have debugged it, It sets and reads cookies when disable using advance option. Its duplicate in sense of cookies disable code but its for IE Advance cookies disable setting issue. In the link you have mark it as duplicate, there is no such conversation for advance setting in IE. Could you please review?
    – Janty
    Sep 29, 2016 at 12:17
  • @mplungjan Can you please help me to update code as I have already checked for both Navigator and By explicitly setting and reading cookies?
    – Janty
    Sep 29, 2016 at 12:24
  • 1
    I have reopened, but do not get your issue. Does this code work for you? var cookies = ("cookie" in document && (document.cookie.length > 0 || (document.cookie = "test").indexOf.call(document.cookie, "test") > -1)) from stackoverflow.com/questions/6125330/…
    – mplungjan
    Sep 29, 2016 at 12:24
  • @mplungjan Thanks It would really help me to find issue. NO Its same thing, there is cookies I have seen as value for document.cookie .
    – Janty
    Sep 29, 2016 at 12:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.