Cookie::forever()
Stores a cookie forever
Cookie::forever(string $key, string $value, array $options = [ ]): bool
Parameters
Name | Type | Default | Description |
---|---|---|---|
$keyrequired | string |
no default value | The name of the cookie |
$valuerequired | string |
no default value | The cookie content |
$options | array |
[ ]
|
Array of options: path, domain, secure, httpOnly |
Return type
bool
true: cookie was created, false: cookie creation failed
Parent class
Examples
// never expires
Cookie::forever('mycookie', 'hello');