Merge pull request #5501 from cakephp/2.6-hotfix-session-tmp-dir

Also autocreate session folder in debug mode
This commit is contained in:
Mark Story 2015-01-02 11:36:53 -05:00
commit 0a4cffc603

View file

@ -494,7 +494,12 @@ class CakeSession {
if (!empty($sessionConfig['handler'])) { if (!empty($sessionConfig['handler'])) {
$sessionConfig['ini']['session.save_handler'] = 'user'; $sessionConfig['ini']['session.save_handler'] = 'user';
} elseif (!empty($sessionConfig['session.save_path']) && Configure::read('debug')) {
if (!is_dir($sessionConfig['session.save_path'])) {
mkdir($sessionConfig['session.save_path'], 0775, true);
} }
}
if (!isset($sessionConfig['ini']['session.gc_maxlifetime'])) { if (!isset($sessionConfig['ini']['session.gc_maxlifetime'])) {
$sessionConfig['ini']['session.gc_maxlifetime'] = $sessionConfig['timeout'] * 60; $sessionConfig['ini']['session.gc_maxlifetime'] = $sessionConfig['timeout'] * 60;
} }