app/library/Services.php: add use session.path instead of application.sessionDir in _initSession()
This commit is contained in:
parent
4ee1073a6b
commit
ffb1881527
1 changed files with 7 additions and 6 deletions
|
|
@ -189,19 +189,20 @@ class Services extends DiDefault
|
|||
|
||||
if (isset($config->session)) {
|
||||
$data = $config->session->toArray();
|
||||
$adapter = $data['adapter'];
|
||||
$adapter = isset($data['adapter']) ? $data['adapter'] : 'Files';
|
||||
$options = $data['options'];
|
||||
|
||||
// For "Files": Set session path if defined.
|
||||
if ($adapter === 'Files' && isset($options['path'])) {
|
||||
session_save_path($config->application->path);
|
||||
}
|
||||
|
||||
$class = 'Phalcon\Session\Adapter\\' . $adapter;
|
||||
$session = new $class($options);
|
||||
}
|
||||
// Default to File storage
|
||||
else {
|
||||
// Set session directory if defined.
|
||||
if (isset($config->application->sessionDir)) {
|
||||
session_save_path($config->application->sessionDir);
|
||||
}
|
||||
$session = new SessionAdapter();
|
||||
$session = new \Phalcon\Session\Adapter\Files();
|
||||
}
|
||||
|
||||
// Start session.
|
||||
|
|
|
|||
Reference in a new issue