cookie::set

Set a new cookie

cookie::set($key, $value, $expires = 0, $path = '/', $domain = null, $secure = false)

Parameters

$key (string)
The name of the cookie
$value (string)
The cookie content
$expires (int)
The number of minutes until the cookie expires
$path (string)
The path on the server to set the cookie for
$domain (string)
the domain
$secure (boolean)
only sets the cookie over https

Return values

boolean
true: the cookie has been created, false: cookie creation failed