I'm trying to get stored cookies using JavaScript. Here's a list of cookies shown in Google Chrome by inspecting the page and going to Resources.
When I run the code:
alert(document.cookie);
It only shows the K----S------C---- cookie, but not the adminhtml cookie. How do I access the adminhtml cookie?
===================================================
Edit:
According to the selected answer, JavaScript can't access HTTP-only cookies. Though I found a workaround. It might not be the most secure, but in a scenario like this where you need to get the cookie information, try this.
Use PHP to write the cookie information to a hidden div:
<div id="adminhtml" style="visibility:hidden"><?php
echo $_COOKIE['adminhtml'];
?></div>
Then use JavaScript to get the innerhtml of the div:
<script>
var cookieValue = document.getElementById("shopperid").innerHTML;
</script>