Navigator cookieEnabledProperty

Navigator 对象参考手册Navigator Object

Definition and Usage

The cookieEnabled property returns a Boolean value. If the browser has cookies enabled, this property is true. If cookies are disabled, the value is false.

Syntax

navigator.cookieEnabled


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the cookieEnabled property


Example

Example

Determine whether the browser has cookies enabled:

<script>

document.write("Cookies enabled: " + navigator.cookieEnabled);

</script>

The above example outputs:


Try it yourself »


实例s

More Examples

This example contains all of the navigator properties.


Navigator 对象参考手册Navigator Object Other Extensions