aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/session.php
diff options
context:
space:
mode:
authorkasimi <mail@kasimi.net>2018-03-09 23:31:57 +0100
committerkasimi <mail@kasimi.net>2018-03-09 23:51:06 +0100
commit85eceeccbee4cac37b73c6b40bac22ad6edb5bbd (patch)
treef8dbebce1cfb5a3c2b7af6ecef30cf3b42716e5c /phpBB/phpbb/session.php
parentadc75b700f0cf3d6d47689c00932fd1f41bc58e9 (diff)
downloadforums-85eceeccbee4cac37b73c6b40bac22ad6edb5bbd.tar
forums-85eceeccbee4cac37b73c6b40bac22ad6edb5bbd.tar.gz
forums-85eceeccbee4cac37b73c6b40bac22ad6edb5bbd.tar.bz2
forums-85eceeccbee4cac37b73c6b40bac22ad6edb5bbd.tar.xz
forums-85eceeccbee4cac37b73c6b40bac22ad6edb5bbd.zip
[ticket/15583] Update session time in AJAX request only once a minute
PHPBB3-15583
Diffstat (limited to 'phpBB/phpbb/session.php')
-rw-r--r--phpBB/phpbb/session.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index de9345ca85..654d377d31 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -1614,13 +1614,15 @@ class session
return;
}
+ // Do not update the session page for ajax requests, so the view online still works as intended
+ $page_changed = $this->update_session_page && $this->data['session_page'] != $this->page['page'] && !$request->is_ajax();
+
// Only update session DB a minute or so after last update or if page changes
- if ($this->time_now - ((isset($this->data['session_time'])) ? $this->data['session_time'] : 0) > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
+ if ($this->time_now - ((isset($this->data['session_time'])) ? $this->data['session_time'] : 0) > 60 || $page_changed)
{
$sql_ary = array('session_time' => $this->time_now);
- // Do not update the session page for ajax requests, so the view online still works as intended
- if ($this->update_session_page && !$request->is_ajax())
+ if ($page_changed)
{
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
$sql_ary['session_forum_id'] = $this->page['forum'];