How to get the name and value pairs of cookies in the current HTML document with JavaScript

1 Answer

0 votes
<!DOCTYPE html>
<html>
<body>

<p id="pid"></p>

<script>
document.getElementById("pid").innerHTML = document.cookie;

/*
run:

PHPSESSID=s87sd7p3nt834eit1nads3o2un; pma_lang=en

*/
</script>

</body>
</html>

 



answered Jan 10, 2019 by avibootz
...