summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers/Session_files_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Session/drivers/Session_files_driver.php')
-rw-r--r--system/libraries/Session/drivers/Session_files_driver.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php
index 92c5ebc03..4a86ec9d6 100644
--- a/system/libraries/Session/drivers/Session_files_driver.php
+++ b/system/libraries/Session/drivers/Session_files_driver.php
@@ -148,6 +148,8 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
.$name // we'll use the session cookie name as a prefix to avoid collisions
.($this->_config['match_ip'] ? md5($_SERVER['REMOTE_ADDR']) : '');
+ $this->php5_validate_id();
+
return $this->_success;
}
@@ -392,6 +394,22 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
// --------------------------------------------------------------------
/**
+ * Validate ID
+ *
+ * Checks whether a session ID record exists server-side,
+ * to enforce session.use_strict_mode.
+ *
+ * @param string $id
+ * @return bool
+ */
+ public function validateId($id)
+ {
+ return is_file($this->_file_path.$id);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Byte-safe strlen()
*
* @param string $str