aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/navigator/cookieenabled/index.md
blob: babc7e40fb5be6ed6e3de271440ba6a8b6ded671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
title: Navigator.cookieEnabled
slug: Web/API/Navigator/cookieEnabled
translation_of: Web/API/Navigator/cookieEnabled
---
{{ ApiRef("HTML DOM") }}

`navigator.cookieEnabled` retourne une valeur booléenne qui indique si les cookies sont activés. Cette propriété est en lecture seule.

## Syntax

```js
var cookieEnabled = navigator.cookieEnabled;
```

- `cookieEnabled` est un [Boolean](/en-US/docs/Glossary/Boolean): `true` ou `false`.

## Example

```js
if (!navigator.cookieEnabled) {
  // Ce navigateur ne supporte pas ou bloque les cookies.
}
```

## Spécifications

| Specification                                                                                                                            | Status                           | Comment             |
| ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------- |
| {{SpecName("HTML WHATWG", "webappapis.html#dom-navigator-cookieenabled", "Navigator.cookieEnabled")}} | {{Spec2("HTML WHATWG")}} | Définition initiale |

## Compatibilité des navigateurs

{{Compat("api.Navigator.cookieEnabled")}}