How to detect that JavaScript Cookies are disabled?

JavascriptWeb DevelopmentFront End Technology

The “navigator.cookieEnabled” object is used to detect whether JavaScript cookies are disabled are not. You can try the following code snippet and check for cookies −

if (navigator.cookieEnabled) {
   document.write("Cookies Enabled");
} else {
   document.write("Oops Cookies Not Enabled");
}
raja
Published on 31-Jan-2018 09:31:33
Advertisements