Skip to content

Commit

Permalink
When the PHP version is 7.2 or higher `ini_set('session.save_handler'…
Browse files Browse the repository at this point in the history
…, 'user')` can't be executed, so delete.
  • Loading branch information
tenkoma committed Jan 16, 2018
1 parent 701519c commit f4315d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Cake/Model/Datasource/CakeSession.php
Expand Up @@ -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);
Expand Down

0 comments on commit f4315d8

Please sign in to comment.