PHP Class Webiny\Component\Http\Session

Inheritance: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\SingletonTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
init ( ) Constructor.

Method Details

delete() public méthode

Removes the given $key from session.
public delete ( string $key ) : boolean
$key string Name of the session key you wish to remove.
Résultat boolean

get() public méthode

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.
Résultat string Value of the given $key.

getAll() public méthode

Get all session values.
public getAll ( ) : array
Résultat array Key-value array of all session entries.

getConfig() public static méthode

Returns session config from Http object.
public static getConfig ( ) : ConfigObject
Résultat Webiny\Component\Config\ConfigObject

getSessionId() public méthode

Get current session id.
public getSessionId ( ) : string
Résultat string Session id.

init() protected méthode

Constructor.
protected init ( )

save() public méthode

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.