W3cubDocs

/DOM

navigator.cookieEnabled

navigator.cookieEnabled returns a Boolean value that indicates whether cookies are enabled or not. The property is read-only.

Syntax

var cookieEnabled = navigator.cookieEnabled;
  • cookieEnabled is a Boolean: true or false.

Example

if (!navigator.cookieEnabled) { 
  // The browser does not support or is blocking cookies from being set.
}

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'Navigator.cookieEnabled' in that specification.
Living Standard Initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 59 Yes 1
1
Prior to Firefox 8, navigator.cookieEnabled would report the wrong result if a site exception was in place for the page on which the check was performed. This has been fixed.
Yes Yes Yes
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 59 59 Yes 4
4
Prior to Firefox 8, navigator.cookieEnabled would report the wrong result if a site exception was in place for the page on which the check was performed. This has been fixed.
Yes Yes ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/navigator/cookieEnabled