This is an example of how to deal with cookies.
<?php
require '../websock2.php';
define('EOL', php_sapi_name() === 'cli' ? PHP_EOL : '<br>');
$manager->getCookieManager()->addCookie(
new HttpCookie(
'code_cookie',
'12345'));
$cookie =
new HttpCookie(
'other_domain_cookie',
'12345');
$cookie->setDomain('php.net');
$manager->getCookieManager()->addCookie($cookie);
$manager->getCookieManager()->filterCookies(
function(
HttpCookie $cookie)
{
.
'] and path: [' . $cookie->
getPath() .
']' . EOL;
if($cookie->
getName() ===
'one_more')
});
echo EOL;