]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix session not working error
authorRobin Appelman <icewind@owncloud.com>
Mon, 27 May 2013 23:10:18 +0000 (01:10 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 27 May 2013 23:10:18 +0000 (01:10 +0200)
lib/base.php
lib/session/internal.php

index c6ea32362e4ed3eb371b57477ace14ae95f0186e..42b57527063f9dc210bc369f13c3ea0bcd99296d 100644 (file)
@@ -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);
 
index 713a154ecc11a37f92899277ad18c3d5314b2cff..1f8fda47a9bdcec41dd53ba85b258b5267837fe9 100644 (file)
@@ -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');