Init dummy session first

This commit is contained in:
Victor Dubiniuk 2013-06-17 23:41:07 +03:00
parent 6156d71832
commit fbbb6ef8ef
1 changed files with 3 additions and 3 deletions

View File

@ -288,14 +288,14 @@ class OC {
$cookie_path = OC::$WEBROOT ?: '/'; $cookie_path = OC::$WEBROOT ?: '/';
ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_path', $cookie_path);
//set the session object to a dummy session so code relying on the session existing still works
self::$session = new \OC\Session\Memory('');
try{ try{
// set the session name to the instance id - which is unique // set the session name to the instance id - which is unique
self::$session = new \OC\Session\Internal(OC_Util::getInstanceId()); self::$session = new \OC\Session\Internal(OC_Util::getInstanceId());
// if session cant be started break with http 500 error // if session cant be started break with http 500 error
}catch (Exception $e){ }catch (Exception $e){
//set the session object to a dummy session so code relying on the session existing still works
self::$session = new \OC\Session\Memory('');
OC_Log::write('core', 'Session could not be initialized', OC_Log::write('core', 'Session could not be initialized',
OC_Log::ERROR); OC_Log::ERROR);