Window navigator.cookieEnabled property
- Previous Page appVersion
- Next Page geolocation
- Go to Parent Directory Window Navigator
Definition and usage
If cookies are enabled in the browser cookieEnabled
Property returns true
.
See also:
Instance
Example 1
Is Cookie enabled in your browser?
let cookies = navigator.cookieEnabled;
Example 2
Display all navigator properties:
let text = "<p>Browser CodeName: " + navigator.appCodeName + "</p>" + "<p>Browser Name: " + navigator.appName + "</p>" + "<p>Browser Version: " + navigator.appVersion + "</p>" + "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>" + "<p>Browser Language: " + navigator.language + "</p>" + "<p>Browser Online: " + navigator.onLine + "</p>" + "<p>Platform: " + navigator.platform + "</p>" + "<p>User-agent header: " + navigator.userAgent + "</p>";
Syntax
navigator.cookieEnabled
Return value
Type | Description |
---|---|
Boolean value | If cookies are enabled in the browser, it returns true, otherwise false. |
Browser support
All browsers support navigator.cookieEnabled
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page appVersion
- Next Page geolocation
- Go to Parent Directory Window Navigator