mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
Merge branch '3.2.x'
* 3.2.x: [ticket/15583] Update session time in AJAX request only once a minute [ticket/15583] Update session time in AJAX request only once a minute
This commit is contained in:
commit
9fd893a2cf
1 changed files with 5 additions and 3 deletions
|
@ -1616,13 +1616,15 @@ class session
|
||||||
return;
|
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
|
// 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);
|
$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 ($page_changed)
|
||||||
if ($this->update_session_page && !$request->is_ajax())
|
|
||||||
{
|
{
|
||||||
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
|
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
|
||||||
$sql_ary['session_forum_id'] = $this->page['forum'];
|
$sql_ary['session_forum_id'] = $this->page['forum'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue