Closed Lednerb closed 6 years ago
Hello,
I'm using this library to simplify my tests for cookies that have set the secure and httpOnly flags.
secure
httpOnly
However, regarding this specification, only the cookiename=value is required, all other directives are optional: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#Directives
cookiename=value
When I'm using:
$cookie = Cookie::parse("Set-Cookie: session=myCookie"); $cookie->isSecureOnly();
I get the following error:
Error: Call to a member function isSecureOnly() on null
Same with $cookie->isHttpOnly().
$cookie->isHttpOnly()
There is an error in this regex, I think: https://github.com/delight-im/PHP-Cookie/blob/master/src/Cookie.php#L380
Thank you very much!
Fixed in https://github.com/delight-im/PHP-Cookie/commit/deecb7d2f5a27a17ad2f89b58d3130ee72272ef4.
Thank you for your fast support.
Hello,
I'm using this library to simplify my tests for cookies that have set the
secure
andhttpOnly
flags.However, regarding this specification, only the
cookiename=value
is required, all other directives are optional: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#DirectivesWhen I'm using:
I get the following error:
Same with
$cookie->isHttpOnly()
.There is an error in this regex, I think: https://github.com/delight-im/PHP-Cookie/blob/master/src/Cookie.php#L380