Skip to content

Instantly share code, notes, and snippets.

@sachin-handiekar
Created September 3, 2014 12:25
Show Gist options
  • Select an option

  • Save sachin-handiekar/716c509b02f3fdb6a5ef to your computer and use it in GitHub Desktop.

Select an option

Save sachin-handiekar/716c509b02f3fdb6a5ef to your computer and use it in GitHub Desktop.
Checking Cookie Enabled/Disabled - JavaScript
function isCookieEnabled()
{
var cookieEnabled = (navigator.cookieEnabled) ? true : false;
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
{
document.cookie="myCookie";
cookieEnabled = (document.cookie.indexOf("myCookie") != -1) ? true : false;
}
return (cookieEnabled);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment