summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/Session_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-10 12:59:20 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-10 12:59:20 +0100
commita027a7fd0d770cec0d71e888d8b6f4aa1568ce9f (patch)
treeee3742051c755d53f9391e93e518de66b2ee17db /system/libraries/Session/Session_driver.php
parent7e0bde27c8a6669b781d87c15ea51b750c91f97c (diff)
Improve ext/session error messages
Diffstat (limited to 'system/libraries/Session/Session_driver.php')
-rw-r--r--system/libraries/Session/Session_driver.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php
index 98fc897e3..55ddb25e0 100644
--- a/system/libraries/Session/Session_driver.php
+++ b/system/libraries/Session/Session_driver.php
@@ -168,4 +168,24 @@ abstract class CI_Session_driver implements SessionHandlerInterface {
return TRUE;
}
+ // ------------------------------------------------------------------------
+
+ /**
+ * Fail
+ *
+ * Drivers other than the 'files' one don't (need to) use the
+ * session.save_path INI setting, but that leads to confusing
+ * error messages emitted by PHP when open() or write() fail,
+ * as the message contains session.save_path ...
+ * To work around the problem, the drivers will call this method
+ * so that the INI is set just in time for the error message to
+ * be properly generated.
+ *
+ * @return mixed
+ */
+ protected function _fail()
+ {
+ ini_set('session.save_path', config_item('sess_save_path'));
+ return $this->_failure;
+ }
}