https://github.com/perchlayer/webird/blob/master/app/phalcon/modules/cli/library/Chat.php#L41
PHP Notice: Undefined property: stdClass::$request in /opt/webird/app/phalcon/modules/cli/library/Chat.php on line 44
This works on 0.3 but it no longer does on 0.4.x-dev. Is it implemented or did something change at Guzzle. I look at sources and documentation in Ratchet and Guzzle but I can't figure out if it changed or not yet implemented.
In 0.4 there are a few changes in this area to be aware of:
So what does that mean? Your code will need to look a bit more like this:
$cookies = $conn->httpRequest->getHeader('Cookie');
Next, you will need to parse it. I haven't done much research into this you could look into dflydev/dflydev-fig-cookies
If you just want to parse the cookie values I would recommend using GuzzleHttp\Psr7\parse_header:
$cookiesHeader = $conn->httpRequest->getHeader('Cookie');
if(count($cookiesHeader)) {
$cookies = \GuzzleHttp\Psr7\parse_header($cookiesHeader)[0];
if (array_key_exists('PHPSESSID', $cookies)) {
// PHPSESSID exists
}
else {
// PHPSESSID does not exit
}
}
else {
// No cookie header
}
@arosolino This works and I like using Guzzle since it is already included in the vendor directory.
Should we leave this open until the 0.4 docs are made and the new version is released?
Most helpful comment
In 0.4 there are a few changes in this area to be aware of:
So what does that mean? Your code will need to look a bit more like this:
Next, you will need to parse it. I haven't done much research into this you could look into dflydev/dflydev-fig-cookies