Negate the flag. MDN checks !navigator.cookieEnabled.
Blocked path. Warn or disable cookie features when false.
Enabled path. Continue with normal cookie usage.
Keep it simple. This is the standard first-line check.
Example 3 — User-Facing Message
Build a short status string for your UI.
JavaScript
const msg = navigator.cookieEnabled
? "Cookies are enabled in this browser."
: "Please enable cookies for the best experience.";
console.log(msg);
// Note: even when enabled, SameSite=None usually needs HTTPS + Secure.
Remember limits. Enabled ≠ every attribute succeeds.
Optional next step. Test-write a cookie for critical flows.
Compatibility
Browser Support
navigator.cookieEnabled is marked Baseline Newly available on MDN (since September 2024). It works across the latest devices and browser versions.
✓ Baseline · Newly available
Navigator.cookieEnabled
Read-only Boolean: whether cookies are enabled. High-level check — not a guarantee for every cookie attribute.
BaselineNewly available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
cookieEnabledExcellent
Bottom line: Safe to use as a first-line cookies check. Still set correct cookie attributes, and verify writes for critical flows when needed.
Frequently Asked Questions
It is a read-only Navigator property that returns a Boolean: true when cookies are enabled, false when the browser does not support cookies or is blocking them from being set.
No. MDN marks it as Baseline Newly available (since September 2024). It is a standard HTML Navigator property — not Deprecated, Experimental, or Non-standard.
Read navigator.cookieEnabled. MDN's pattern: if (!navigator.cookieEnabled) { /* cookies unsupported or blocked */ }.
Not always. Browsers may still block certain cookies in some scenarios — for example SameSite=None cookies often need HTTPS and the Secure attribute. cookieEnabled is a high-level on/off check, not a guarantee for every cookie option.
No. The property is read-only. You read the Boolean; you do not assign to it.
For critical flows, you can also try a short-lived test cookie and verify it was stored. cookieEnabled is the quick first check; a write/read test confirms storage for your site's rules.