Window navigator.cookieEnabled property

Definition and usage

If cookies are enabled in the browser cookieEnabled Property returns true.

See also:

JavaScript Cookies Tutorial

Instance

Example 1

Is Cookie enabled in your browser?

let cookies = navigator.cookieEnabled;

Try it yourself

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>";

Try it yourself

Syntax

navigator.cookieEnabled

Return value

Type Description
Boolean value If cookies are enabled in the browser, it returns true, otherwise false.

Browser support

All browsers support navigator.cookieEnabled:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support