diff options
author | dchill42 <dchill42@gmail.com> | 2012-08-08 18:03:46 +0200 |
---|---|---|
committer | dchill42 <dchill42@gmail.com> | 2012-08-08 18:03:46 +0200 |
commit | f79afb57b7f7bac62a79638f195560739e4a80ef (patch) | |
tree | e0c05232c233dc215d37afa088662cae4148a487 /system | |
parent | 2642920e4781db091309ab97d0ff43c22e7c7e44 (diff) |
Added session_id to userdata and applied sess_time_to_update
Diffstat (limited to 'system')
-rwxr-xr-x | system/libraries/Session/drivers/Session_native.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/system/libraries/Session/drivers/Session_native.php b/system/libraries/Session/drivers/Session_native.php index 356deb4dc..04c985574 100755 --- a/system/libraries/Session/drivers/Session_native.php +++ b/system/libraries/Session/drivers/Session_native.php @@ -42,6 +42,7 @@ class CI_Session_native extends CI_Session_driver { 'sess_expiration', 'sess_match_ip', 'sess_match_useragent', + 'sess_time_to_update', 'cookie_prefix', 'cookie_path', 'cookie_domain' @@ -117,6 +118,14 @@ class CI_Session_native extends CI_Session_driver { session_start(); } + // Check for update time + if ($config['sess_time_to_update'] && isset($_SESSION['last_activity']) && + ($_SESSION['last_activity'] + $config['sess_time_to_update']) < $now) + { + // Regenerate ID, but don't destroy session + $this->sess_regenerate(FALSE); + } + // Set activity time $_SESSION['last_activity'] = $now; @@ -131,6 +140,9 @@ class CI_Session_native extends CI_Session_driver { // Store user agent string $_SESSION['user_agent'] = trim(substr($CI->input->user_agent(), 0, 50)); } + + // Make session ID available + $_SESSION['session_id'] = session_id(); } /** @@ -178,6 +190,7 @@ class CI_Session_native extends CI_Session_driver { { // Just regenerate id, passing destroy flag session_regenerate_id($destroy); + $_SESSION['session_id'] = session_id(); } /** |