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
orfalse
.
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 compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.