summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers/Session_files_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-08-10 14:26:57 +0200
committerAndrey Andreev <narf@devilix.net>2016-08-10 14:26:57 +0200
commitc4bd43432df03e4f4835c7689c8ed722cd2c3020 (patch)
tree5603166833d78b0581bbe880adb53b6de085719d /system/libraries/Session/drivers/Session_files_driver.php
parent488ad40ba334ca506f07bede97724726eac2b27f (diff)
parent9180a1264dc536c34e5cc8a0e44bb399a8ba484f (diff)
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/libraries/Session/drivers/Session_files_driver.php')
-rw-r--r--system/libraries/Session/drivers/Session_files_driver.php15
1 files changed, 3 insertions, 12 deletions
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php
index 57c3777a2..bf4df8b20 100644
--- a/system/libraries/Session/drivers/Session_files_driver.php
+++ b/system/libraries/Session/drivers/Session_files_driver.php
@@ -149,18 +149,9 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
// which re-reads session data
if ($this->_file_handle === NULL)
{
- // Just using fopen() with 'c+b' mode would be perfect, but it is only
- // available since PHP 5.2.6 and we have to set permissions for new files,
- // so we'd have to hack around this ...
- if (($this->_file_new = ! file_exists($this->_file_path.$session_id)) === TRUE)
- {
- if (($this->_file_handle = fopen($this->_file_path.$session_id, 'w+b')) === FALSE)
- {
- log_message('error', "Session: File '".$this->_file_path.$session_id."' doesn't exist and cannot be created.");
- return $this->_failure;
- }
- }
- elseif (($this->_file_handle = fopen($this->_file_path.$session_id, 'r+b')) === FALSE)
+ $this->_file_new = ! file_exists($this->_file_path.$session_id);
+
+ if (($this->_file_handle = fopen($this->_file_path.$session_id, 'c+b')) === FALSE)
{
log_message('error', "Session: Unable to open file '".$this->_file_path.$session_id."'.");
return $this->_failure;