class SessionManager implements SessionManagerInterface (View source)

Properties

protected $currentSession
protected $remoteSessions

Methods

__construct(SessionMetaDataStore $sessionMetaDataStore, SessionKeyValueStore $sessionKeyValueStore, float $garbageCollectionProbability, int $garbageCollectionMaximumPerRun, int $inactivityTimeout)

No description

getCurrentSession()

Returns the currently active session which stores session data for the current HTTP request on this local system.

bool
initializeCurrentSessionFromCookie(Cookie $cookie)

No description

bool
createCurrentSessionFromCookie(Cookie $cookie)

No description

SessionInterface|null
getSession(string $sessionIdentifier)

Returns the specified session. If no session with the given identifier exists, NULL is returned.

array
getActiveSessions()

Returns all active sessions, even remote ones.

array
getSessionsByTag(string $tag)

Returns all sessions which are tagged by the specified tag.

int
destroySessionsByTag(string $tag, string $reason = '')

Destroys all sessions which are tagged with the specified tag.

int|null
collectGarbage()

Iterates over all existing sessions and removes their data if the inactivity timeout was reached.

void
shutdownObject()

Shuts down this session

Details

__construct(SessionMetaDataStore $sessionMetaDataStore, SessionKeyValueStore $sessionKeyValueStore, float $garbageCollectionProbability, int $garbageCollectionMaximumPerRun, int $inactivityTimeout)

No description

Parameters

SessionMetaDataStore $sessionMetaDataStore
SessionKeyValueStore $sessionKeyValueStore
float $garbageCollectionProbability
int $garbageCollectionMaximumPerRun
int $inactivityTimeout

SessionInterface getCurrentSession()

Returns the currently active session which stores session data for the current HTTP request on this local system.

Return Value

SessionInterface

bool initializeCurrentSessionFromCookie(Cookie $cookie)

No description

Parameters

Cookie $cookie

Return Value

bool

Exceptions

InvalidDataInSessionDataStoreException

bool createCurrentSessionFromCookie(Cookie $cookie)

No description

Parameters

Cookie $cookie

Return Value

bool

Exceptions

Exception

SessionInterface|null getSession(string $sessionIdentifier)

Returns the specified session. If no session with the given identifier exists, NULL is returned.

Parameters

string $sessionIdentifier

Return Value

SessionInterface|null

Exceptions

InvalidDataInSessionDataStoreException
SessionNotStartedException

array getActiveSessions()

Returns all active sessions, even remote ones.

Return Value

array

Exceptions

NotSupportedByBackendException

array getSessionsByTag(string $tag)

Returns all sessions which are tagged by the specified tag.

Parameters

string $tag

A valid Cache Frontend tag

Return Value

array

A collection of Session objects or an empty array if tag did not match

Exceptions

NotSupportedByBackendException

int destroySessionsByTag(string $tag, string $reason = '')

Destroys all sessions which are tagged with the specified tag.

Parameters

string $tag

A valid Cache Frontend tag

string $reason

A reason to mention in log output for why the sessions have been destroyed. For example: "The corresponding account was deleted"

Return Value

int

Number of sessions which have been destroyed

Exceptions

SessionNotStartedException
NotSupportedByBackendException

int|null collectGarbage()

Iterates over all existing sessions and removes their data if the inactivity timeout was reached.

Return Value

int|null

The number of outdated entries removed or NULL if no such information could be determined

Exceptions

Exception

void shutdownObject()

Shuts down this session

This method must not be called manually – it is invoked by Flow's object management.

Return Value

void

Exceptions

NotSupportedByBackendException
Exception