$cookie = Cookie::
fromString('foo=bar; expires=Fri, 20 May 2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly'
);
$this->
assertTrue($cookie->
isHttpOnly());
$cookie = Cookie::
fromString('foo=bar; expires=Fri, 20 May 2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure'
);
$this->
assertFalse($cookie->
isHttpOnly());
} public function testSameSiteAttribute() { $cookie =
new Cookie('foo', 'bar', 0, '/', null, false, true, false, 'Lax'
);
$this->
assertEquals('lax',
$cookie->
getSameSite());
$cookie =
new Cookie('foo', 'bar', 0, '/', null, false, true, false, ''
);
$this->
assertNull($cookie->
getSameSite());
$cookie = Cookie::
create('foo'
)->
withSameSite('Lax'
);
$this->
assertEquals('lax',
$cookie->
getSameSite());
} public function testSetSecureDefault() { $cookie = Cookie::
create('foo', 'bar'
);