‪TYPO3CMS  10.4
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.

Referenced by TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\gc(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\gc().

◆ get()

◆ 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
array$configuration

To be used only by SessionManager

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

◆ remove()

◆ 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

Parameters
string$sessionId
array$sessionData
Returns
‪array The newly created session record.
Exceptions
SessionNotCreatedException

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

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\createUserSession(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\regenerateSessionId(), and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\storeSessionData().

◆ 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
string$sessionId
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.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\fetchUserSession(), TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\removeSessionData(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setAndSaveSessionData(), TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\storeSessionData(), and TYPO3\CMS\Beuser\Controller\BackendUserController\switchUser().

◆ 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.