Method: cookie::set
Set a new cookie
Info
Syntax
cookie::set($key, $value, $expires=3600, $domain='/')
Parameters
- $key (string) The name of the cookie
- $value (string) The cookie content
- $expires (int) The number of seconds until the cookie expires
- $domain (string) The domain to set this cookie for.
Return (boolean)
true: the cookie has been created, false: cookie creation failed
Example
cookie::set('mycookie', 'hello', 3600);
// expires in 1 hour