2

On a web page, I need all the cookies' name and value. The problem is that, for example, on Google Chrome, I can see cookie information using Developers Tools > Resources > Cookies, but it returns an empty string when I type "document.cookie" on the console.

Is there a 'javascript way' to display the coookie information as it is seen in the Resources tab?

JackLametta
  • 400
  • 1
  • 2
  • 20
benchpresser
  • 2,115
  • 2
  • 19
  • 35

1 Answers1

1

Those cookies are HTTP-only cookies and you cannot access them via Javascript. This would cause major security vulnerabilities.

For more clarification on security check OWASP documentation

https://www.owasp.org/index.php/HttpOnly

Mario Nikolaus
  • 2,212
  • 1
  • 20
  • 26