PHP Класс Webiny\Component\Http\Session

Наследование: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\SingletonTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
delete ( string $key ) : boolean Removes the given $key from session.
get ( string $key, mixed $value = null ) : string Get a session value for the given $key.
getAll ( ) : array Get all session values.
getConfig ( ) : ConfigObject Returns session config from Http object.
getSessionId ( ) : string Get current session id.
save ( string $key, mixed $value ) Save, or overwrite, a session value under the given $key with the given $value.

Защищенные методы

Метод Описание
init ( ) Constructor.

Описание методов

delete() публичный Метод

Removes the given $key from session.
public delete ( string $key ) : boolean
$key string Name of the session key you wish to remove.
Результат boolean

get() публичный Метод

If key doesn't not exist, $value will be returned and assigned under that key.
public get ( string $key, mixed $value = null ) : string
$key string Key for which you wish to get the value.
$value mixed Default value that will be returned if $key doesn't exist.
Результат string Value of the given $key.

getAll() публичный Метод

Get all session values.
public getAll ( ) : array
Результат array Key-value array of all session entries.

getConfig() публичный статический Метод

Returns session config from Http object.
public static getConfig ( ) : ConfigObject
Результат Webiny\Component\Config\ConfigObject

getSessionId() публичный Метод

Get current session id.
public getSessionId ( ) : string
Результат string Session id.

init() защищенный Метод

Constructor.
protected init ( )

save() публичный Метод

Save, or overwrite, a session value under the given $key with the given $value.
public save ( string $key, mixed $value )
$key string Key for which you wish to get the value.
$value mixed Value that will be stored under the $key.