简体   繁体   English

有没有一种方法可以检查Cookie是否仅在PHP中是httponly

[英]Is there a way to check if a cookie is httponly in PHP

有没有办法检查cookie是否在php中是httponly?

I don't think that's possible, because this information is not included in the raw headers sent by the browser. 我认为这是不可能的,因为此信息未包含在浏览器发送的原始标头中。 In fact, it doesn't make sense to send flags like these back to the server, because they are meaningless to the server and only wastes bandwidth. 实际上,将这样的标志发送回服务器是没有意义的,因为它们对服务器没有意义,只会浪费带宽。

Well, yes. 嗯,是。 You'll find it in the array returned by session_get_cookie_params , as long as your PHP is 5.2.0 or newer. 只要您的PHP是5.2.0或更高版本,就可以在session_get_cookie_params返回的数组中找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM