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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant