HelpersCookie

HelpersCookie

The Cookie helper has the following methods:

Cookie::exists($key);

Returns true or false

Cookie::set($key, $value, $expiry = self::FOURYEARS, $path = "/", $domain = false);

$key - the name of the cookie

$value - the value the cookie holds

$expiry - time to hold the cookie

$path - the path the cookie accepts

domain - the domain to be used defaults to false

Cookie::get($key, $default = '')

Get the key from a cookie

Cookie::display()

Returns the $_COOKIE

Cookie::destroy($key, $path = "/", $domain = "")

Remove/Delete cookie match the id of $key

原文地址:https://www.cnblogs.com/chunguang/p/5643106.html