Is there a way to check if the cookie is httponly in php?
Is there a way to check if a cookie is httponly in PHP
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.
The OP is reffering to any cookie and your answer seems to be only about session cookie. –
Eurystheus
NO!
session_get_cookie_params()
just gets global values from php.ini
, not for specific cookie. –
Affusion 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.
The OP is reffering to any cookie and your answer seems to be only about session cookie. –
Eurystheus
NO!
session_get_cookie_params()
just gets global values from php.ini
, not for specific cookie. –
Affusion © 2022 - 2024 — McMap. All rights reserved.
session_get_cookie_params()
. For cookies that are being set in the current request, you can useResponseHeader::get('Cookie')
andCookie::parse($cookieHeader)
. And, finally, for all cookies that have already been set, you're out of luck. – Mons