Skip to content

Commit 3ce60fc

Browse files
committed
Don't regenerate sessions during AJAX requests
This is a partial fix ... no locking = not safe for concurrency, but so many people have complained about it, that we might as well just commit this.
1 parent 3989f1a commit 3ce60fc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

system/libraries/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ function sess_create()
360360
function sess_update()
361361
{
362362
// We only update the session every five minutes by default
363-
if (($this->userdata['last_activity'] + $this->sess_time_to_update) >= $this->now)
363+
if ($this->CI->input->is_ajax_request() OR ($this->userdata['last_activity'] + $this->sess_time_to_update) >= $this->now)
364364
{
365365
return;
366366
}

user_guide/changelog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ <h3>Bug fixes:</h3>
8181
<li>Fixed a bug (#2508) - <a href="libraries/config.html">Config Library</a> didn't properly detect if the current request is via HTTPS.</li>
8282
<li>Fixed a bug (#3314) - SQLSRV <a href="database/index.html">Database driver</a>'s method <samp>count_all()</samp> didn't escape the supplied table name.</li>
8383
<li>Fixed a bug (#3404) - MySQLi <a href="database/index.html">Database driver</a>'s method <samp>escape_str()</samp> had a wrong fallback to <samp>mysql_escape_string()</samp> when there was no active connection.</li>
84+
<li>Fixed a bug in the <a href="libraries/sessions.html">Session Library</a> where session ID regeneration occurred during AJAX requests.</li>
8485
</ul>
8586

8687
<h2>Version 2.2.0</h2>

0 commit comments

Comments
 (0)