Fix session not working error
This commit is contained in:
parent
44f9af5a7f
commit
e73c04501e
|
@ -290,9 +290,12 @@ class OC {
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ namespace OC\Session;
|
||||||
*/
|
*/
|
||||||
class Internal extends Memory {
|
class Internal extends Memory {
|
||||||
public function __construct($name) {
|
public function __construct($name) {
|
||||||
session_write_close();
|
|
||||||
session_name($name);
|
session_name($name);
|
||||||
if (@session_start()) {
|
if (@session_start()) {
|
||||||
throw new \Exception('Failed to start session');
|
throw new \Exception('Failed to start session');
|
||||||
|
|
Loading…
Reference in New Issue