Chrome developer tools > resources > cookies > http column, does a checkmark here indicate HttpOnly cookie?

孤街醉人 提交于 2019-11-30 12:23:37

问题


Does the checkmark at the Http column of Chrome devtool's Cookie resource panel indicate a HttpOnly cookie?

I can't find docs that confirm this, though I suspect it is the case. I am trying to verify my app is using HttpOnly for session cookies.


回答1:


Yes. Enter document.cookie in the console, and you'll see that none of the checked cookies are visible.

HTTP = HttpOnly flag, Secure = secure flag.




回答2:


Yes. Right click on your page or press F12 button. This will open developers tools window. Go to application tab. It'll show as follow :-

Now, typing document.cookie on the tab, you'll see only csrf token being shown.

To specify session cookies to be httpCookie by default, set 'useHttpOnly' attribute in context.xml in tomcat, for java web application. For more information, refer to http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes




回答3:


So 2 things .

1) HTTP only cookie this name is a bit misleading as we can send HTTPOnly cookie over HTTPS and it works perfectly fine. Main characteristics of HTTP Only cookie is it can't be accessed using JavaScript . In-fact You can't even manually edit this in Chrome's Application tab.

2) So how you can edit HTTP Only cookie ? In chrome You can use extension to edit cookie while development . In production mode there is no way you can adultrate this without man in the middle attack on HTTP connection.




回答4:


Today (May 2016), googling around for the same reason, I found this question and this page from developers.google.com explaining:

HTTP: If present, indicates that cookies should be used only over HTTP, and JavaScript modification is not allowed.



来源:https://stackoverflow.com/questions/11378025/chrome-developer-tools-resources-cookies-http-column-does-a-checkmark-her

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!