summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-02-26 15:01:12 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-02-26 15:01:12 +0000
commitad98d39d4d97272b7762bc818bb46dec6272d006 (patch)
tree0dfd306bde61c7fab90b1ae66256d5bc4c2df221 /index.php
parent269fd10d8b81cb5e33a7a34320b7f88f5aec76eb (diff)
downloadwebtrees-ad98d39d4d97272b7762bc818bb46dec6272d006.tar.gz
webtrees-ad98d39d4d97272b7762bc818bb46dec6272d006.tar.bz2
webtrees-ad98d39d4d97272b7762bc818bb46dec6272d006.zip
Remove global constant WT_TIMESTAMP
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/index.php b/index.php
index 09f86cd233..d58e31412c 100644
--- a/index.php
+++ b/index.php
@@ -157,14 +157,15 @@ if ($max_execution_time !== '' && strpos(ini_get('disable_functions'), 'set_time
// Sessions
Session::start();
-define('WT_TIMESTAMP', Carbon::now('UTC')->timestamp);
+// Update the last-login time no more than once a minute.
+$next_session_update = Carbon::createFromTimestamp((int) Session::get('session_time_updates'))->addMinute();
+if ($next_session_update < Carbon::now()) {
+ $timestamp_now = Carbon::now()->timestamp;
-// Update the last-login time no more than once a minute
-if (WT_TIMESTAMP - Session::get('activity_time') >= 60) {
if (Session::get('masquerade') === null) {
- Auth::user()->setPreference('sessiontime', (string) WT_TIMESTAMP);
+ Auth::user()->setPreference('sessiontime', (string) $timestamp_now);
}
- Session::put('activity_time', WT_TIMESTAMP);
+ Session::put('session_time_updates', $timestamp_now);
}
DebugBar::startMeasure('routing');