Initialization Cookie
Notice: PHP setcookie don't recommended 'expire' set to 0, The effect is not the same across platforms.
The parameter format is as follows:
Set the prefix 'name'
Set cookie
Permanently save cookie
Check a cookie
Get a cookie / if the parameter is empty, Get all cookies
Delete the specified cookies
Clear all cookies
<?php use Asf\Http\Cookie; $cookie = new Cookie(['path' => '/', 'domain' => 'box3.cn', 'expire' => 3600, 'secure' => 1, 'httponly' => 1, 'prefix' => 'Asf_']); print_r($cookie); var_dump($cookie->has('a')); var_dump($cookie->has(123)); var_dump($cookie->get('a')); var_dump($cookie->get(123)); var_dump($cookie->get()); var_dump($cookie->set('a', 123456)); var_dump($cookie->set(123, 'string')); var_dump($cookie->del('a', 123)); var_dump($cookie->clear()); var_dump($cookie->forever('a', 123456)); var_dump($cookie->forever(123, 'string'));