Implement session inactivity expiration handling.

This commit is contained in:
netkas 2025-01-03 21:22:02 -05:00
parent b9b7b23e9e
commit e9269a24fc
4 changed files with 32 additions and 1 deletions

View file

@ -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;
}