From a9da3dd2f16a8f97d7bc4ff5572b28e4bb84c813 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 12 Jun 2018 16:40:12 +0300 Subject: [ci skip] Prepare 3.1.9 release --- system/libraries/Session/Session_driver.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'system/libraries/Session/Session_driver.php') diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php index bef5ee41f..2fe30b8a2 100644 --- a/system/libraries/Session/Session_driver.php +++ b/system/libraries/Session/Session_driver.php @@ -112,6 +112,23 @@ abstract class CI_Session_driver implements SessionHandlerInterface { // ------------------------------------------------------------------------ + /** + * PHP 5.x validate ID + * + * Enforces session.use_strict_mode on PHP 5.x (7+ does it by itself) + * + * @return void + */ + public function php5_validate_id() + { + if (PHP_VERSION_ID < 70000 && isset($_COOKIE[$this->_config['cookie_name']]) && ! $this->validateId($_COOKIE[$this->_config['cookie_name']])) + { + unset($_COOKIE[$this->_config['cookie_name']]); + } + } + + // ------------------------------------------------------------------------ + /** * Cookie destroy * -- cgit v1.2.3-24-g4f1b