Stores a value in a cookie, by default the cookie will expire in one day.
public static set ( string $key, mixed $value, integer $time = 2592000, string $path = '/', string $domain = null, boolean $secure = null, boolean $httpOnly = true ) : boolean | ||
$key | string | A name for the cookie. |
$value | mixed | The value to be stored. Keep in mind that they will be serialized. |
$time | integer | The number of seconds that this cookie will be available, 30 days is the default. |
$path | string | The path on the server in which the cookie will be available. Use / for the entire domain, /foo if you just want it to be available in /foo. |
$domain | string | The domain that the cookie is available on. Use .example.com to make it available on all subdomains of example.com. |
$secure | boolean | Should the cookie be transmitted over a HTTPS-connection? If true, make sure you use a secure connection, otherwise the cookie won't be set. |
$httpOnly | boolean | Should the cookie only be available through HTTP-protocol? If true, the cookie can't be accessed by Javascript, ... |
return | boolean | If set with success, returns true otherwise false. |