Chrome developer tools > resources > cookies > htt

2020-02-20 07:20发布

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.

4条回答
贼婆χ
2楼-- · 2020-02-20 07:48

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 :-

enter image description here

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

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楼-- · 2020-02-20 07:50

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.

查看更多
一纸荒年 Trace。
4楼-- · 2020-02-20 07:52

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

Name Value Domain Path Expires Size HTTP Secure

HTTP = HttpOnly flag, Secure = secure flag.

查看更多
相关推荐>>
5楼-- · 2020-02-20 08:05

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.

查看更多
登录 后发表回答