Formagic session interface

package Formagic\Session
author Florian Sonnenburg
since 1.1.0 First time introduced

 Methods

Returns a value from session storage

get(string $key) : mixed

Parameters

$key

string

Session key

Exceptions

\Formagic_Exception_SessionException if value not exists

Returns

mixedValue from session storage

Checks if a value is present in session.

has(string $key) : boolean

This method will also return a positive result if the value is empty (null, empty string false, int 0).

Parameters

$key

string

Variable key

Returns

boolean

Clears all Formagic value from the session.

purge() : \Formagic_Session_Interface

Returns

\Formagic_Session_InterfaceFluent interface

Removes a value from session storage.

remove(string $key) : \Formagic_Session_Interface

Will silently do nothing if key does not exist.

Parameters

$key

string

Session key

Returns

\Formagic_Session_InterfaceFluent interface

Saves a value into session storage

set(string $key, mixed $value) : \Formagic_Session_Interface

Parameters

$key

string

Session key

$value

mixed

Value to be saved into session

Returns

\Formagic_Session_InterfaceFluent interface