summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers/Session_cookie.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-07-17 18:59:20 +0200
committerAndrey Andreev <narf@devilix.net>2013-07-17 18:59:20 +0200
commite18de50dc1a4369aef18df9b368f8bfb0f9177d9 (patch)
tree07708fb20dbe57adc99f4d71683b8b22673a2d28 /system/libraries/Session/drivers/Session_cookie.php
parent2ecc06ce74e089f6d57ed396f006b749e7741999 (diff)
Cherry-picking some changes from PR #2425:
- Session events logging (debug) - Bug fix for OCI8 method stored_procedure()
Diffstat (limited to 'system/libraries/Session/drivers/Session_cookie.php')
-rw-r--r--system/libraries/Session/drivers/Session_cookie.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index 7174d63c8..d3d22d03a 100644
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -402,6 +402,7 @@ class CI_Session_cookie extends CI_Session_driver {
// Is the session data we unserialized an array with the correct format?
if ( ! is_array($session) OR ! isset($session['session_id'], $session['ip_address'], $session['user_agent'], $session['last_activity']))
{
+ log_message('debug', 'Session: Wrong cookie data format');
$this->sess_destroy();
return FALSE;
}
@@ -409,6 +410,7 @@ class CI_Session_cookie extends CI_Session_driver {
// Is the session current?
if (($session['last_activity'] + $this->sess_expiration) < $this->now OR $session['last_activity'] > $this->now)
{
+ log_message('debug', 'Session: Expired');
$this->sess_destroy();
return FALSE;
}
@@ -416,6 +418,7 @@ class CI_Session_cookie extends CI_Session_driver {
// Does the IP match?
if ($this->sess_match_ip === TRUE && $session['ip_address'] !== $this->CI->input->ip_address())
{
+ log_message('debug', 'Session: IP address mismatch');
$this->sess_destroy();
return FALSE;
}
@@ -424,6 +427,7 @@ class CI_Session_cookie extends CI_Session_driver {
if ($this->sess_match_useragent === TRUE &&
trim($session['user_agent']) !== trim(substr($this->CI->input->user_agent(), 0, 120)))
{
+ log_message('debug', 'Session: User Agent string mismatch');
$this->sess_destroy();
return FALSE;
}
@@ -459,6 +463,7 @@ class CI_Session_cookie extends CI_Session_driver {
// No result? Kill it!
if (empty($query) OR $query->num_rows() === 0)
{
+ log_message('debug', 'Session: No match found in our database');
$this->sess_destroy();
return FALSE;
}
@@ -498,6 +503,8 @@ class CI_Session_cookie extends CI_Session_driver {
'last_activity' => $this->now,
);
+ log_message('debug', 'Session: Creating new session ('.$this->userdata['session_id'].')');
+
// Check for database
if ($this->sess_use_database === TRUE)
{
@@ -536,6 +543,8 @@ class CI_Session_cookie extends CI_Session_driver {
{
// Get new id
$this->userdata['session_id'] = $this->_make_sess_id();
+
+ log_message('debug', 'Session: Regenerate ID');
}
// Check for database