Fix duplicate session_set_save_handler call from handler instantiation.

This commit is contained in:
Pascal Woerde 2019-11-26 13:39:22 +01:00
parent d2e1681eb8
commit 2affcdfb00
No known key found for this signature in database
GPG key ID: F570D8D1F32A661D

View file

@ -587,8 +587,9 @@ class CakeSession {
if (!empty($sessionConfig['handler']) && !isset($sessionConfig['handler']['engine'])) {
call_user_func_array('session_set_save_handler', $sessionConfig['handler']);
}
if (!empty($sessionConfig['handler']['engine']) && !headers_sent() && (!function_exists('session_status') || session_status() !== PHP_SESSION_ACTIVE)) {
if (!empty($sessionConfig['handler']['engine']) && !headers_sent()) {
$handler = static::_getHandler($sessionConfig['handler']['engine']);
if (!function_exists('session_status') || session_status() !== PHP_SESSION_ACTIVE) {
session_set_save_handler(
array($handler, 'open'),
array($handler, 'close'),
@ -598,6 +599,7 @@ class CakeSession {
array($handler, 'gc')
);
}
}
Configure::write('Session', $sessionConfig);
static::$sessionTime = static::$time;
if (!static::$_useForwardsCompatibleTimeout) {