- fixed init session _race condition_ on MySQL session setup, where sessions table is not already setup _before_ storing session data, #595
This commit is contained in:
@@ -112,7 +112,6 @@ class Controller {
|
||||
* @param \Base $f3
|
||||
*/
|
||||
protected function initSession(\Base $f3){
|
||||
$sessionCacheKey = $f3->get('SESSION_CACHE');
|
||||
$session = null;
|
||||
|
||||
/**
|
||||
@@ -135,10 +134,13 @@ class Controller {
|
||||
};
|
||||
|
||||
if(
|
||||
$sessionCacheKey === 'mysql' &&
|
||||
$f3->get('SESSION_CACHE') === 'mysql' &&
|
||||
$this->getDB('PF') instanceof DB\SQL
|
||||
){
|
||||
$session = new DB\SQL\Session($this->getDB('PF'), 'sessions', true, $onSuspect);
|
||||
|
||||
if(!headers_sent() && session_status()!=PHP_SESSION_ACTIVE){
|
||||
$session = new DB\SQL\Session($this->getDB('PF'), 'sessions', true, $onSuspect);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user