Reputation: 1221
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"
Upvotes: 4
Views: 3305
Reputation: 3330
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.
More references: SOQuestion1, SOQuestion2, SOQuestion3
Upvotes: 6