Cookie class
package | Fuel |
---|---|
category | Helpers |
author | Kohana Team |
modified | Fuel Development Team |
copyright | (c) 2008-2010 Kohana Team |
license | http://kohanaframework.org/license |
link | http://docs.fuelphp.com/classes/cookie.html |
_init()
delete(string $name, string $path, string $domain, boolean $secure, boolean $http_only) : boolean
Cookie::delete('theme');
uses | \Fuel\Core\static::set |
---|
string
cookie name
string
path of the cookie
string
domain of the cookie
boolean
if true, the cookie should only be transmitted over a secure HTTPS connection
boolean
if true, the cookie will be made accessible only through the HTTP protocol
boolean
get(string $name, mixed $default) : string
Cookies without signatures will not be returned. If the cookie signature is present, but invalid, the cookie will be deleted.
// Get the "theme" cookie, or use "blue" if the cookie does not exist
$theme = Cookie::get('theme', 'blue');
string
cookie name
mixed
default value to return
string
set(string $name, string $value, integer $expiration, string $path, string $domain, boolean $secure, boolean $http_only) : boolean
Note that all cookie values must be strings and no automatic serialization will be performed!
// Set the "theme" cookie
Cookie::set('theme', 'red');
string
name of cookie
string
value of cookie
integer
lifetime in seconds
string
path of the cookie
string
domain of the cookie
boolean
if true, the cookie should only be transmitted over a secure HTTPS connection
boolean
if true, the cookie will be made accessible only through the HTTP protocol
boolean
$config : array