JavaScript returns a method that compares all key values of the current session cookie

  • 2020-05-26 07:44:12
  • OfStack

The example in this article shows how JavaScript can return all key values of cookie for the current session. Share with you for your reference. The details are as follows:

The JS code below outputs all cookie key value comparisons


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

The output results on the machine are as follows;

Cookies associated with this document: __gads=ID=88235e28adb2de90:T=1371793250:S=ALNI_MZZqvAlWhTDl1EqFEU4EKH4ZMmPlQ; ASPSESSIONIDSQQDBSSD=AIAFKJPBBOEKIJNAMAOMGJJH; ASPSESSIONIDSQQBCTSD=EPOMLBJDJBKBGKHBJMBGDDPC; __qca=P0-1744690351-1372043640630; ASPSESSIONIDQSSDASTC=EFKIBPODBGMKHIINAGPNMFCA; ASPSESSIONIDQQRBCTTC=FHFAALIBDLEDFDCFJMKIHICP; __utma=119627022.880502788.1371793248.1372301378.1372312534.8; __utmb=119627022.4.10.1372312534; __utmc=119627022; __utmz=119627022.1371803017.3.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=ofstack.com

I hope this article has been helpful to your javascript programming.


Related articles: