JavaScript can read the cookies. The following is a simple command we can put in our JSP page to read the current used cookies:
<body>
<script type="text/javascript">
document.write(document.cookie);
</script>
</body>
We have written the content of the cookie represented by the document.cookie JavaScript command in the page.