class CookieJar (View source)

Properties

protected $cookies
protected $clearedCookies
protected $request

Methods

Cookie
set(string $name, string|null $value = null, int $expire, string $path = '/', null|string $domain = null, bool $secure = false, bool $httpOnly = true)

Adds a CookieObject to the cookie pantry.

add(Cookie $cookie)

Adds a CookieObject to the array of cookies for the object.

bool
has(string $cookie)

Used to determine if the cookie key exists in the pantry.

clear($cookie)

No description

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

No description

Cookie[]
getCookies()

No description

getClearedCookies()

No description

setRequest(Request $request)

Set a request for this cookie jar

getRequest()

No description

Details

Cookie set(string $name, string|null $value = null, int $expire, string $path = '/', null|string $domain = null, bool $secure = false, bool $httpOnly = true)

Adds a CookieObject to the cookie pantry.

Parameters

string $name The cookie name
string|null $value The value of the cookie
int $expire The number of seconds until the cookie expires
string $path The path for the cookie
null|string $domain The domain the cookie is available to
bool $secure whether the cookie should only be transmitted over a HTTPS connection from the client
bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol

Return Value

Cookie

add(Cookie $cookie)

Adds a CookieObject to the array of cookies for the object.

Parameters

Cookie $cookie

bool has(string $cookie)

Used to determine if the cookie key exists in the pantry.

Parameters

string $cookie

Return Value

bool

clear($cookie)

Parameters

$cookie

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

Parameters

string $name The key the cookie is stored under
mixed $default A value to return if the cookie isn't set

Return Value

mixed

Cookie[] getCookies()

Return Value

Cookie[]

getClearedCookies()

setRequest(Request $request)

Set a request for this cookie jar

Parameters

Request $request

protected getRequest()