coderef

cookieEnabledBaseline · Newly available

The navigator.cookieEnabled property is a boolean for whether the browser accepts or ignores attempts to write cookie data.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Sep 16, 2024.

Browser support

DesktopChrome
1+Supportedsince Dec 11, 2008
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1+Supportedsince Nov 9, 2004
Current: 157
Safari
1–17.6Not supported
18+Supportedsince Sep 16, 2024
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1–17.6Not supported
18+Supportedsince Sep 16, 2024
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Sep 16, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: cookieEnabled.

Feature detection

JS · check before using
if ("Navigator" in globalThis && "cookieEnabled" in Navigator.prototype) {
  // Navigator.cookieEnabled is available
}