Sunday, 31 May 2020

How to read a HTTP only cookie using JavaScript

Hello Friends,


In this article, I will explain how to read an HTTP only cookie using JavaScript

In the last week, I was working with one issue where we need to access HTTP only cookie using JavaScript. 




So the answer is No We can not access HTTP only cookies using javascript. HttpOnly cookie is that it's not accessible to client-side scripting,


What I did find on a website was:

"The big security hole, as alluded to above, is that Firefox (and presumably Opera) allow access to the headers through XMLHttpObject. So you could make a trivial JavaScript call back to the local server, get the headers out of the string, and then post that back to an external domain. Not as easy as document.cookie, but hardly a feat of software engineering.


 You could set a hidden variable or inline code with the cookie value when the server processes it



Don’t forget to leave your feedback and comments below!
If you have any query mail me to Sujeet.bhujbal@gmail.com     
Happy programming!!
Don’t forget to leave your feedback and comments below!
Regards
Sujeet Bhujbal
--------------------------------------------------------------------------------
------------------------------------------------------------------------------

0 comments:

Post a comment