4

After clearing my browser history when I go to this URL: http://indianvisa-bangladesh.nic.in/visa/index.html

then I click on "Get Appointment" green link which takes us to http://indianvisa-bangladesh.nic.in/visa/Appointment_Login.jsp

Here it sets a JSESSIONID cookie. I can see this cookie in both Firefox/Chrome developer tools but can't access it using document.cookie in console.

When I type document.cookie; it shows empty string.

How do I print it?

Edit: Also this JSESSIONID cookie has Path value of "/visa"

enter image description here

user5858
  • 1,082
  • 4
  • 39
  • 79

1 Answers1

6

The reason behind you can't read this cookie is because it is HTTPOnly Cookie, So if you are developer then you can set it easily false in your code when you are creating it. otherwise you can't get it using javascript. This is specifcally a feature rather than a bug provided by all major browsers.

See below for HTTP flag enter image description here

More references: SOQuestion1, SOQuestion2, SOQuestion3

Community
  • 1
  • 1
Parag Bhayani
  • 3,280
  • 2
  • 28
  • 52