Navigator.cookieEnabled

Esta tradução está incompleta. Ajude a traduzir este artigo em inglês

navigator.cookieEnabled retorna um valor Booleano que indica quando cookies estão habilitados ou não. A propriedade é de apenas leitura.

Sintaxe

var cookieEnabled = navigator.cookieEnabled;
  • cookieEnabled é um Booleano: true ou false.

Exemplo

if (!navigator.cookieEnabled) { 
  // The browser does not support or is blocking cookies from being set.
}

Especificações

Especificação Status Comentário
HTML Living Standard
The definition of 'Navigator.cookieEnabled' in that specification.
Padrão em tempo real Initial definition

Compatibilidade entre navegadores

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
cookieEnabledChrome Full support 1Edge Full support 12Firefox Full support 1
Notes
Full support 1
Notes
Notes Prior to Firefox 8, navigator.cookieEnabled would report the wrong result if a site exception was in place for the page on which the check was performed. This has been fixed.
IE Full support 4Opera Full support ≤12.1Safari Full support 1WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4
Notes
Full support 4
Notes
Notes Prior to Firefox 8, navigator.cookieEnabled would report the wrong result if a site exception was in place for the page on which the check was performed. This has been fixed.
Opera Android Full support ≤12.1Safari iOS Full support 1Samsung Internet Android Full support 1.0

Legend

Full support  
Full support
See implementation notes.
See implementation notes.