#3073 (feature/session): Don't regenerate IDs on AJAX requests
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index f250c3d..bf11cd1 100644
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -122,7 +122,11 @@
session_start();
- if (($regenerate_time = config_item('sess_time_to_update')) > 0)
+ // Is session ID auto-regeneration configured? (ignoring ajax requests)
+ if ( ! empty($_SERVER['HTTP_X_REQUESTED_WITH'])
+ && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'
+ && $regenerate_time = config_item('sess_time_to_update')) > 0
+ )
{
if ( ! isset($_SESSION['__ci_last_regenerate']))
{