Search w3schools.com:

SHARE THIS PAGE

Document cookie Property

Document Object Reference Document Object

Definition and Usage

The cookie property returns all name/value pairs of cookies in the current document.

Syntax

document.cookie


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The cookie property is supported in all major browsers.


Example

Example

Return the cookies associated with the current document:

<html>
<body>

Cookies associated with this document:
<script>
document.write(document.cookie);
</script>

</body>
</html>

Try it yourself »


Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]