Cookie
in package

This is the Cookie management class.

Cookies will be managed on that class.

Tags
see
Cookie::set()
see
Cookie::get()
see
Cookie::getAll()
see
Cookie::exist()
see
Cookie::unset()
see
Cookie::clear()
see
Cookie::send()

Table of Contents

clear() Unsets all the available COOKIEs.  : void
exist() Checks if the COOKIE identified by the given key exists.  : bool
get() Returns the data stored on the given COOKIE key.  : string|null
getAll() Returns all the stored cookies.  : array<string|int, mixed>
send() Send the setted cookies on this class to set and unset them from user's browser.  : void
set() Adds a COOKIE with the given key and value.  : void
unset() Unsets the COOKIE with the given key.  : void

Methods

clear()

Unsets all the available COOKIEs.

public static clear() : void
Return values
void

exist()

Checks if the COOKIE identified by the given key exists.

public static exist(string $key) : bool
Parameters
$key : string

Name of the COOKIE you want to check.

Return values
bool

get()

Returns the data stored on the given COOKIE key.

public static get(string $key) : string|null
Parameters
$key : string

Name of the COOKIE you want to get.

Return values
string|null

getAll()

Returns all the stored cookies.

public static getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

send()

Send the setted cookies on this class to set and unset them from user's browser.

public static send() : void
Return values
void

set()

Adds a COOKIE with the given key and value.

public static set(string $key, string $value) : void

The Cookie will be setted on the user's browser only by calling the "send" method.

Parameters
$key : string
$value : string
Return values
void

unset()

Unsets the COOKIE with the given key.

public static unset(string $key) : void

The Cookie will be unsetted on the user's browser only by calling the "send" method.

Parameters
$key : string
Return values
void

Search results