‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Session\Backend\SessionBackendInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Session\Backend\SessionBackendInterface:
TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend TYPO3\CMS\Core\Session\Backend\RedisSessionBackend

Public Member Functions

 initialize (string $identifier, array $configuration)
 
 validateConfiguration ()
 
array getAll ()
 
array get (string $sessionId)
 
bool remove (string $sessionId)
 
array set (string $sessionId, array $sessionData)
 
array update (string $sessionId, array $sessionData)
 
 collectGarbage (int $maximumLifetime, int $maximumAnonymousLifetime=0)
 

Detailed Description

Interface SessionBackendInterface

Definition at line 27 of file SessionBackendInterface.php.

Member Function Documentation

◆ collectGarbage()

TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::collectGarbage ( int  $maximumLifetime,
int  $maximumAnonymousLifetime = 0 
)

Garbage Collection

Parameters
int$maximumLifetime‪maximum lifetime of authenticated user sessions, in seconds.
int$maximumAnonymousLifetime‪maximum lifetime of non-authenticated user sessions, in seconds. If set to 0, nothing is collected.

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

◆ get()

array TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::get ( string  $sessionId)

Read session data

Returns
‪array Returns the session data
Exceptions
SessionNotFoundException

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

◆ getAll()

array TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::getAll ( )

List all sessions

Returns
‪array Return a list of all user sessions. The list may be empty.

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

Referenced by TYPO3\CMS\Core\Session\SessionManager\invalidateAllSessionsByUserId().

◆ initialize()

TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::initialize ( string  $identifier,
array  $configuration 
)

Initializes the session backend

Parameters
string$identifier‪Name of the session type, e.g. FE or BE

To be used only by SessionManager

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

◆ remove()

bool TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::remove ( string  $sessionId)

Delete a session record

Returns
‪bool true if the session was deleted, false it session could not be found

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

Referenced by TYPO3\CMS\Core\Session\SessionManager\invalidateAllSessionsByUserId().

◆ set()

array TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::set ( string  $sessionId,
array  $sessionData 
)

Write session data. This method prevents overriding existing session data. ses_id will always be set to $sessionId and overwritten if existing in $sessionData This method updates ses_tstamp automatically

Returns
‪array The newly created session record.
Exceptions
SessionNotCreatedException

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

◆ update()

array TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::update ( string  $sessionId,
array  $sessionData 
)

Updates the session data. ses_id will always be set to $sessionId and overwritten if existing in $sessionData This method updates ses_tstamp automatically

Parameters
array$sessionData‪The session data to update. Data may be partial.
Returns
‪array $sessionData The newly updated session record.
Exceptions
SessionNotUpdatedException

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.

◆ validateConfiguration()

TYPO3\CMS\Core\Session\Backend\SessionBackendInterface::validateConfiguration ( )

Checks if the configuration is valid

Exceptions

Implemented in TYPO3\CMS\Core\Session\Backend\RedisSessionBackend, and TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend.