Window navigator.cookieEnabled property
- 上一页 appVersion
- 下一页 geolocation
- 返回上一层 Window Navigator
Definition and usage
If cookies are enabled in the browser cookieEnabled
Property returns true
.
See also:
Instance
Example 1
Are cookies 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 is true, otherwise it is false. |
Browser support
All browsers support navigator.cookieEnabled
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
- 上一页 appVersion
- 下一页 geolocation
- 返回上一层 Window Navigator