static public set ( string $key, string $value, integer $expires = 3600, string $domain = '/' ) : boolean | ||
$key | string | The name of the cookie |
$value | string | The cookie content |
$expires | integer | 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 |
static function set($key, $value, $expires = 3600, $domain = '/')
{
if (is_array($value)) {
$value = a::json($value);
}
$_COOKIE[$key] = $value;
return @setcookie($key, $value, time() + $expires, $domain);
}
public static function set($type, $id, $message) { $c = config::get('notes'); $c['name'] = "note-{$type}-{$id}"; $c['value'] = $message; cookie::set($c); }