LaravelCookie

Summary

No protected properties found
N/A
No private methods found
No private properties found
N/A
File
cookie.php
Package
Default
Class hierarchy
LaravelCookie

Tags

None found

Constants

forever

forever

How long is forever (in minutes)?

Tags

None found

Properties

$jar

$jar : array

The cookies that have been set.

Type

array

Tags

None found

Methods

has()

has(string  $name) : boolean

Determine if a cookie exists.

Parameters

string $name

Returns

boolean

static

Tags

None found

get()

get(string  $name, mixed  $default = null) : string

Get the value of a cookie.

// Get the value of the "favorite" cookie $favorite = Cookie::get('favorite');

// Get the value of a cookie or return a default value
$favorite = Cookie::get('framework', 'Laravel');

Parameters

string $name
mixed $default

Returns

string

static

Tags

None found

put()

put(string  $name, string  $value, integer  $expiration, string  $path = '/', string  $domain = null, boolean  $secure = false) : void

Set the value of a cookie.

// Set the value of the "favorite" cookie Cookie::put('favorite', 'Laravel');

// Set the value of the "favorite" cookie for twenty minutes
Cookie::put('favorite', 'Laravel', 20);

Parameters

string $name
string $value
integer $expiration
string $path
string $domain
boolean $secure

static

Tags

None found

forever()

forever(string $name, string $value, string $path = '/', string $domain = null, boolean $secure = false) : boolean

Set a "permanent" cookie. The cookie will last for one year.

// Set a cookie that should last one year Cookie::forever('favorite', 'Blue');

Parameters

string $name
string $value
string $path
string $domain
boolean $secure

Returns

boolean

static

Tags

None found

forget()

forget(string  $name, string  $path = '/', string  $domain = null, boolean  $secure = false) : boolean

Delete a cookie.

Parameters

string $name
string $path
string $domain
boolean $secure

Returns

boolean

static

Tags

None found

hash()

hash(string  $value) : string

Hash the given cookie value.

Parameters

string $value

Returns

string

static

Tags

None found

parse()

parse(string  $value) : string

Parse a hash fingerprinted cookie value.

Parameters

string $value

Returns

string

static

Tags

None found