Skip to content
Permalink
Browse files

When the PHP version is 7.2 or higher `ini_set('session.save_handler'…

…, 'user')` can't be executed, so delete.
  • Loading branch information...
tenkoma committed Jan 16, 2018
1 parent 701519c commit f4315d8ba4a13b14e31b48ff65c4f0f7c9cbca56
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/Cake/Model/Datasource/CakeSession.php
@@ -552,6 +552,12 @@ protected static function _configureSession() {
if (!empty($sessionConfig['handler'])) {
$sessionConfig['ini']['session.save_handler'] = 'user';
// In PHP7.2.0+ session.save_handler can't be set to 'user' by the user.
// https://github.com/php/php-src/commit/a93a51c3bf4ea1638ce0adc4a899cb93531b9f0d
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
unset($sessionConfig['ini']['session.save_handler']);
}
} elseif (!empty($sessionConfig['session.save_path']) && Configure::read('debug')) {
if (!is_dir($sessionConfig['session.save_path'])) {
mkdir($sessionConfig['session.save_path'], 0775, true);

0 comments on commit f4315d8

Please sign in to comment.
You can’t perform that action at this time.