Commit ba629c47 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Session expired: report details about session timestamps

parent 85f9d329
Pipeline #1265 passed with stage
in 1 minute and 52 seconds
......@@ -321,6 +321,7 @@ const ERROR_MISSING_SESSIONNAME = 2400;
const ERROR_QFQ_SESSION_MISSING = 2401;
const ERROR_SESSION_BROKEN_SCRIPT_PATH = 2402;
const ERROR_MISSING_COOKIE = 2403;
const ERROR_SESSION_EXPIRED = 2404;
const ERROR_HTML2PDF_MISSING_CONFIG = 2500;
const ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE = 2501;
......
......@@ -157,7 +157,8 @@ class Session {
$feUserSession = Session::get(SESSION_FE_USER);
$feUserGroup = false;
self::$lastActivity = false; // Session Timeout only exists for logged in FE users - the default is no user logged in, so set to false to switch of session expiration.
// Session Timeout only exists for logged in FE users - the default is no user logged in, so set to false to switch of session expiration.
self::$lastActivity = false;
if (isset($GLOBALS["TSFE"])) {
// if no one is logged in: 0
......@@ -316,7 +317,9 @@ class Session {
}
if (time() - self::$lastActivity > $timeout) {
throw new UserFormException("Your session is expired. Please logout and login again.");
throw new UserFormException(json_encode(
[ERROR_MESSAGE_TO_USER => 'Your session is expired. Please logout and login again.',
ERROR_MESSAGE_SUPPORT => "lastActivity:" . self::$lastActivity . ' Timeout:' . $timeout]), ERROR_SESSION_EXPIRED);
}
}
......
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