diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-05-28 01:10:18 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-05-28 01:10:18 +0200 |
commit | e73c04501ebfe5d7e3f7895b349c941b7483ae6f (patch) | |
tree | 5fbc3ac08310c27a87081abd6602fbfd292d3434 | |
parent | 44f9af5a7fb6f0f9846bfb36ff99f9bf8aee5985 (diff) | |
download | nextcloud-server-e73c04501ebfe5d7e3f7895b349c941b7483ae6f.tar.gz nextcloud-server-e73c04501ebfe5d7e3f7895b349c941b7483ae6f.zip |
Fix session not working error
-rw-r--r-- | lib/base.php | 5 | ||||
-rw-r--r-- | lib/session/internal.php | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php index c6ea32362e4..42b57527063 100644 --- a/lib/base.php +++ b/lib/base.php @@ -290,9 +290,12 @@ class OC { try{ // 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 }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); diff --git a/lib/session/internal.php b/lib/session/internal.php index 713a154ecc1..1f8fda47a9b 100644 --- a/lib/session/internal.php +++ b/lib/session/internal.php @@ -17,7 +17,6 @@ namespace OC\Session; */ class Internal extends Memory { public function __construct($name) { - session_write_close(); session_name($name); if (@session_start()) { throw new \Exception('Failed to start session'); |