Implement session inactivity expiration handling.
This commit is contained in:
parent
b9b7b23e9e
commit
e9269a24fc
4 changed files with 32 additions and 1 deletions
|
@ -409,7 +409,18 @@
|
|||
// Verify if the session is active
|
||||
if($session->getState() !== SessionState::ACTIVE)
|
||||
{
|
||||
self::returnError(403, StandardError::FORBIDDEN, 'Session is not active');
|
||||
self::returnError(403, StandardError::FORBIDDEN, 'Session is not active (' . $session->getState()->value . ')');
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
SessionManager::updateLastRequest($session->getUuid());
|
||||
}
|
||||
catch (DatabaseOperationException $e)
|
||||
{
|
||||
Logger::getLogger()->error('Failed to update the last request time for the session', $e);
|
||||
self::returnError(500, StandardError::INTERNAL_SERVER_ERROR, 'Failed to update the session', $e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue