Navigator.cookieEnabled
Baseline 2024Newly 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
retorna um valor Booleano que indica quando cookies estão habilitados ou não. A propriedade é de apenas leitura.
Sintaxe
js
var cookieEnabled = navigator.cookieEnabled;
cookieEnabled
é um Booleano:true
oufalse
.
Exemplo
js
if (!navigator.cookieEnabled) {
// The browser does not support or is blocking cookies from being set.
}
Especificações
Specification |
---|
HTML # dom-navigator-cookieenabled-dev |
Compatibilidade com navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cookieEnabled |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
- See implementation notes.
- Has more compatibility info.
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.