HTML DOM cookieProperty
Document Object
Definition and Usage
The cookie property returns allkey/valuepairs of all cookies.
Syntax
document.cookie
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the cookie property
Examples
Example
All cookies associated with the current document:
<html>
<body>
Cookies related to this document:
<script>
document.write(document.cookie);
</script>
</body>
</html>
<body>
Cookies related to this document:
<script>
document.write(document.cookie);
</script>
</body>
</html>
Try it Yourself »
Document Object Other Extensions