Commit 5896bfa0 authored by Clément OUDOT's avatar Clément OUDOT

Update activity before checking session expiration (#1262)

parent 8a6c7b73
......@@ -440,22 +440,6 @@ sub retrieveSession {
$class->logger->debug("Get session $id");
# Verify that session is valid
if (
$now - $session->data->{_utime} > $class->tsv->{timeout}
or ( $class->tsv->{timeoutActivity}
and $session->data->{_lastSeen}
and $now - $session->data->{_lastSeen} >
$class->tsv->{timeoutActivity} )
)
{
$class->logger->info("Session $id expired");
# Clean cached data
$class->datas( {} );
return 0;
}
# Update the session to notify activity, if necessary
if (
$class->tsv->{timeoutActivity}
......@@ -474,6 +458,22 @@ sub retrieveSession {
}
}
# Verify that session is valid
if (
$now - $session->data->{_utime} > $class->tsv->{timeout}
or ( $class->tsv->{timeoutActivity}
and $session->data->{_lastSeen}
and $now - $session->data->{_lastSeen} >
$class->tsv->{timeoutActivity} )
)
{
$class->logger->info("Session $id expired");
# Clean cached data
$class->datas( {} );
return 0;
}
$class->datasUpdate($now);
return $session->data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment