class SessionStorage implements UserStorage

Session storage for Nette\Security\User object.

Methods

__construct(Session $sessionHandler)

No description

void
saveAuthentication(IIdentity $identity)

Sets the authenticated state of user.

void
clearAuthentication(bool $clearIdentity)

Removed authenticated state of user.

array
getState()

Returns user authenticated state, identity and logout reason.

void
setExpiration(string|null $time, bool $clearIdentity = false)

Enables log out from the persistent storage after inactivity (like '20 minutes').

setNamespace(string $namespace)

Changes namespace; allows more users to share a session.

string
getNamespace()

Returns current namespace.

SessionSection|null
getSessionSection(bool $need)

Returns and initializes $this->sessionSection.

Details

at line 35
__construct(Session $sessionHandler)

Parameters

Session $sessionHandler

at line 41
void saveAuthentication(IIdentity $identity)

Sets the authenticated state of user.

Parameters

IIdentity $identity

Return Value

void

at line 54
void clearAuthentication(bool $clearIdentity)

Removed authenticated state of user.

Parameters

bool $clearIdentity

Return Value

void

at line 69
array getState()

Returns user authenticated state, identity and logout reason.

Return Value

array ?IIdentity, ?int}

at line 78
void setExpiration(string|null $time, bool $clearIdentity = false)

Enables log out from the persistent storage after inactivity (like '20 minutes').

Parameters

string|null $time
bool $clearIdentity

Return Value

void

at line 99
SessionStorage setNamespace(string $namespace)

Changes namespace; allows more users to share a session.

Parameters

string $namespace

Return Value

SessionStorage

at line 112
string getNamespace()

Returns current namespace.

Return Value

string

at line 121
protected SessionSection|null getSessionSection(bool $need)

Returns and initializes $this->sessionSection.

Parameters

bool $need

Return Value

SessionSection|null

Traits

Strict class for better experience.