Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil) . Junte-se a nós e ajude a fazer o trabalho!

Returns a Boolean value indicating whether cookies are enabled or not (read-only).

Syntax

var cookieEnabled = navigator.cookieEnabled;
  • cookieEnabled is a Boolean true or false.

Example

if (!navigator.cookieEnabled) { 
  // let the user know that enabling cookies makes the web page much more useful
}

Specifications

Specification Status Comment
WHATWG HTML Living Standard
The definition of 'Navigator.cookieEnabled' in that specification.
Living Standard Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 1.0 (1.7 or earlier) (Yes)[1] (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 1.0 (1.0)[1] ? ? ?

[1] Prior to Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5), window.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.

Etiquetas do documento e colaboradores

 Última atualização por: Sebastianz,