Merge pull request #3750 from owncloud/dummy_session_for_errors

Init dummy session to render error pages
remotes/origin/stable6
Thomas Müller 12 years ago
commit 39cca72964
  1. 6
      lib/base.php

@ -288,14 +288,14 @@ class OC {
$cookie_path = OC::$WEBROOT ?: '/';
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{
// set the session name to the instance id - which is unique
self::$session = new \OC\Session\Internal(OC_Util::getInstanceId());
// if session cant be started break with http 500 error
}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::ERROR);

Loading…
Cancel
Save