Class yii\authclient\SessionStateStorage

Inheritanceyii\authclient\SessionStateStorage » yii\base\Component
Implementsyii\authclient\StateStorageInterface
Available since version2.1

SessionStateStorage provides Auth client state storage based on web session.

See also:

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$session \yii\web\Session|array|string Session object or the application component ID of the session object to be used. yii\authclient\SessionStateStorage

Public Methods

Hide inherited methods

MethodDescriptionDefined By
get() Returns the state variable value with the variable name. yii\authclient\SessionStateStorage
init() yii\authclient\SessionStateStorage
remove() Removes a state variable. yii\authclient\SessionStateStorage
set() Adds a state variable. yii\authclient\SessionStateStorage

Property Details

$session public property

Session object or the application component ID of the session object to be used.

After the SessionStateStorage object is created, if you want to change this property, you should only assign it with a session object.

If not set - application 'session' component will be used, but only, if it is available (e.g. in web application), otherwise - no session will be used and no data saving will be performed.

public \yii\web\Session|array|string $session null

Method Details

get() public method

Returns the state variable value with the variable name.

If the variable does not exist, the $defaultValue will be returned.

public mixed get ( $key )
$key string

The variable name

return mixed

The variable value, or null if the variable does not exist.

init() public method

public void init ( )
remove() public method

Removes a state variable.

public boolean remove ( $key )
$key string

The name of the variable to be removed

return boolean

Success.

set() public method

Adds a state variable.

If the specified name already exists, the old value will be overwritten.

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

Variable name

$value mixed

Variable value