From 6fd8d3f5180700e9b288d2d8446b5e09413c6230 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Oct 2019 11:18:12 +0300 Subject: [ci skip] Fix #5857 --- system/libraries/Session/drivers/Session_files_driver.php | 4 ++++ user_guide_src/source/changelog.rst | 1 + 2 files changed, 5 insertions(+) diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php index 2899b7dec..d9966273b 100644 --- a/system/libraries/Session/drivers/Session_files_driver.php +++ b/system/libraries/Session/drivers/Session_files_driver.php @@ -196,6 +196,10 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle $this->_fingerprint = md5(''); return ''; } + + // Prevent possible data corruption + // See https://github.com/bcit-ci/CodeIgniter/issues/5857 + clearstatcache(TRUE, $this->_file_path.$session_id); } // We shouldn't need this, but apparently we do ... // See https://github.com/bcit-ci/CodeIgniter/issues/4039 diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index fe63c8bed..079794b29 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -16,6 +16,7 @@ Bug fixes for 3.1.12 - Fixed a bug (#5834) - :doc:`Query Builder ` method ``count_all_results()`` triggered an SQL error for queries with a ``HAVING`` clause. - Fixed a bug (#5840) - :doc:`Cache Library ` 'redis' driver triggered an ``E_DEPRECATED`` warning about ``sRemove()`` with phpRedis 5. +- Fixed a bug (#5857) - :doc:`Session ` data could be corrupted after a concurrent request write with the 'files' driver due to a filesize cache being incorrect. Version 3.1.11 ============== -- cgit v1.2.3-24-g4f1b