cookies() public method

NOTE: Cookies values are expected to be scalar. This function will not serialize cookie values. If you wish to store a non-scalar value, you must serialize the data first.
public cookies ( string $key = null, string $value = null ) : mixed
$key string
$value string
return mixed
Beispiel #1
0
 public function testConstructWithCookies()
 {
     $request = new Request(array('host' => 'localhost', 'port' => 443, 'headers' => array('Cookie' => 'name1=value1; name2=value2'), 'body' => array('Part 1'), 'params' => array('param' => 'value')));
     $expected = array('name1' => 'value1', 'name2' => 'value2');
     $this->assertEqual($expected, $request->cookies());
 }