class UserStorage implements IUserStorage

Session storage for user object.

Methods

__construct(Session $sessionHandler)

No description

setAuthenticated(bool $state)

Sets the authenticated status of this user.

bool
isAuthenticated()

Is this user authenticated?

setIdentity(IIdentity|null $identity)

Sets the user identity.

IIdentity|null
getIdentity()

Returns current user identity, if any.

setNamespace(string $namespace)

Changes namespace; allows more users to share a session.

string
getNamespace()

Returns current namespace.

setExpiration(string|null $time, int $flags = 0)

Enables log out after inactivity. Accepts flag IUserStorage::CLEAR_IDENTITY.

int|null
getLogoutReason()

Why was user logged out?

SessionSection|null
getSessionSection(bool $need)

Returns and initializes $this->sessionSection.

Details

at line 33
__construct(Session $sessionHandler)

No description

Parameters

Session $sessionHandler

at line 43
IUserStorage setAuthenticated(bool $state)

Sets the authenticated status of this user.

Parameters

bool $state

Return Value

IUserStorage

at line 66
bool isAuthenticated()

Is this user authenticated?

Return Value

bool

at line 77
IUserStorage setIdentity(IIdentity|null $identity)

Sets the user identity.

Parameters

IIdentity|null $identity

Return Value

IUserStorage

at line 87
IIdentity|null getIdentity()

Returns current user identity, if any.

Return Value

IIdentity|null

at line 98
UserStorage setNamespace(string $namespace)

Changes namespace; allows more users to share a session.

Parameters

string $namespace

Return Value

UserStorage

at line 111
string getNamespace()

Returns current namespace.

Return Value

string

at line 121
IUserStorage setExpiration(string|null $time, int $flags = 0)

Enables log out after inactivity. Accepts flag IUserStorage::CLEAR_IDENTITY.

Parameters

string|null $time
int $flags

Return Value

IUserStorage

at line 142
int|null getLogoutReason()

Why was user logged out?

Return Value

int|null

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

Returns and initializes $this->sessionSection.

Parameters

bool $need

Return Value

SessionSection|null

Traits

Strict class for better experience.