-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] httpOnly flag is ignored in set() for cookies #13464
Comments
what do you get when you invoke this method? It is clear that default property value is set to true: as you already outlined. So |
I'm executing the following code
which gives me |
I have the same issue! Phalcon version 3.4.1 (migrated from 3.3.x). |
I have the same. Strange, because source code looks like right. class ExtraCookie extends \Phalcon\Http\Cookie
{
public function __construct($name, $value = null, $expire = 0, $path = "/", $secure = null, $domain = null, $httpOnly = null)
{
parent::__construct($name, $value, $expire, $path, $secure, $domain, $httpOnly);
var_dump($httpOnly);
var_dump($this->_httpOnly);
}
}
$cookie = new ExtraCookie('test-cookie', 'some value', time() + 8400, '/', false, null, false);
Version => 3.4.2 |
Thsi has been resolved |
System:
By default
httpOnly
seems to be active (see). In API documentation one can see, that with the last parameter of methodset
this flag can be set.But, regardless of value I'm using, the cookie is sent with active
httpOnly
to browser, always.Ex. in controller:
The only way I get
httpOnly
removed is by calling following statements right afterset()
:So the flag in
set()
seems to be ignored (all other parameters are working correctly, onlyhttpOnly
is set totrue
always). That's not very comfortable. This is urgent to me, so to be sure I fall back to nativesetcookie()
now.What I do not understand is, that the flag
httpOnly
is optional and declared withnull
when callingset()
. But as property in classCookie
it's initialized withtrue
, see here.The text was updated successfully, but these errors were encountered: