SessionManagerInterface
interface SessionManagerInterface (View source)
Interface for a session manager
In order to stay compatible with future features and create more portable apps, make sure to inject this interface instead of the concrete SessionManager implementation.
Methods
Returns the currently active session which stores session data for the current HTTP request on this local system.
Returns the specified session. If no session with the given identifier exists, NULL is returned.
Returns all active sessions, even remote ones.
Returns all sessions which are tagged by the specified tag.
Destroys all sessions which are tagged with the specified tag.
Remove data of all sessions which are considered to be expired.
Details
SessionInterface
getCurrentSession()
Returns the currently active session which stores session data for the current HTTP request on this local system.
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()
Remove data of all sessions which are considered to be expired.