English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Navigator cookieEnabled Property

JavaScript Navigator Object

cookieEnabledThe property returns a boolean value indicating whether cookies are enabled in the browser.

This property returns true if cookies are enabledtrue, otherwise returnsfalse.

You can find more information in ourJavaScript Cookies TutorialLearn more about cookies.

Syntax:

navigator.cookieEnabled
var x = navigator.cookieEnabled;
document.querySelector("#output").innerHTML = x;
Test See </›

Browser Compatibility

All browsers fully support the cookieEnabled property:

Property
cookieEnabledYesYesYesYesYes

Technical Details

Return value:Boolean value, returns true if cookies are enabled, otherwise returns false

More Examples

This example displays all Navigator properties:

var txt = "";
txt += "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt += "<p>Browser Name: " + navigator.appName + "</p>";
txt += "<p>Browser Version: " + navigator.appVersion + "</p>";
txt += "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt += "<p>Browser Language: " + navigator.language + "</p>";
txt += "<p>Browser Online: " + navigator.onLine + "</p>";
txt += "<p>Platform: " + navigator.platform + "</p>";
txt += "<p>User-agent header: " + navigator.userAgent + "</p>";
document.write(txt);
Test See </›

Related References

Navigator Reference:navigator.appCodeName property

Navigator Reference:navigator.appname property

Navigator Reference:navigator.appVersion property

Navigator Reference:navigator.language property

Navigator Reference:navigator.onLine property

Navigator Reference:navigator.platform property

Navigator Reference:navigator.userAgent property

JavaScript Navigator Object