Methods summary
public static
boolean
|
#
has( string $name )
Determine if a cookie exists.
Determine if a cookie exists.
Parameters
Returns
boolean
|
public static
string
|
#
get( string $name, mixed $default = null )
Get the value of a cookie.
Get the value of a cookie.
$favorite = Cookie::get('favorite');
$favorite = Cookie::get('framework', 'Laravel');
Parameters
- $name
string $name
- $default
mixed $default
Returns
string
|
public static
|
#
put( string $name, string $value, integer $expiration = 0, string $path = '/', string $domain = null, boolean $secure = false )
Set the value of a cookie.
Set the value of a cookie.
Cookie::put('favorite', 'Laravel');
Cookie::put('favorite', 'Laravel', 20);
Parameters
- $name
string $name
- $value
string $value
- $expiration
integer $expiration
- $path
string $path
- $domain
string $domain
- $secure
boolean $secure
|
public static
boolean
|
#
forever( string $name, string $value, string $path = '/', string $domain = null, boolean $secure = false )
Set a "permanent" cookie. The cookie will last for one year.
Set a "permanent" cookie. The cookie will last for one year.
Cookie::forever('favorite', 'Blue');
Parameters
- $name
string $name
- $value
string $value
- $path
string $path
- $domain
string $domain
- $secure
boolean $secure
Returns
boolean
|
public static
boolean
|
#
forget( string $name, string $path = '/', string $domain = null, boolean $secure = false )
Delete a cookie.
Parameters
- $name
string $name
- $path
string $path
- $domain
string $domain
- $secure
boolean $secure
Returns
boolean
|
public static
string
|
#
hash( string $value )
Hash the given cookie value.
Hash the given cookie value.
Parameters
Returns
string
|
protected static
string
|
#
parse( string $value )
Parse a hash fingerprinted cookie value.
Parse a hash fingerprinted cookie value.
Parameters
Returns
string
|