Navigator: cookieEnabled property

Baseline 2024
Newly available

Since September 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

navigator.cookieEnabled returns a Boolean value that indicates whether cookies are enabled or not.

The property is read-only.

Value

A boolean.

Note: Web browsers may prevent writing certain cookies in certain scenarios. For example, Chrome-based browsers, as well as some experimental version of Firefox, does not allow creating cookies with SameSite=None attribute, unless they are created over HTTPS and with Secure attribute.

Examples

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

Specifications

Specification
HTML
# dom-navigator-cookieenabled-dev

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Node.js
cookieEnabled
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1 (Release date: 2004-11-09)
footnote
footnote Before 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.
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Partial support
Safari 1 – 17.6 (Release date: 2003-06-23)
footnote Partial support
footnote Returns true even if the browser is set to block cookies if navigator.cookieEnabled is invoked inside a third-party iframe)
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote
footnote Before Firefox for Android 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.
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 1 – 17.6 (Release date: 2007-06-29)
footnote Partial support
footnote Returns true even if the browser is set to block cookies if navigator.cookieEnabled is invoked inside a third-party iframe)
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 1 – 17.6 (Release date: 2007-06-29)
footnote Partial support
footnote Returns true even if the browser is set to block cookies if navigator.cookieEnabled is invoked inside a third-party iframe)
WebView on iOS – Full support
WebView on iOS 18 (Release date: 2024-09-16)
footnote Full support
Node.js – No support
Node.js
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
See implementation notes.
Has more compatibility info.