diff options
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php index 1f921b13e67..2435661dfa6 100644 --- a/lib/base.php +++ b/lib/base.php @@ -452,13 +452,15 @@ class OC { $useCustomSession = false; $session = self::$server->getSession(); OC_Hook::emit('OC', 'initSession', array('session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession)); - if($useCustomSession) { - // use the session reference as the new Session - self::$server->setSession($session); - } else { + if (!$useCustomSession) { // set the session name to the instance id - which is unique - self::$server->setSession(new \OC\Session\Internal($sessionName)); + $session = new \OC\Session\Internal($sessionName); } + + $cryptoWrapper = \OC::$server->getSessionCryptoWrapper(); + $session = $cryptoWrapper->wrapSession($session); + self::$server->setSession($session); + // if session cant be started break with http 500 error } catch (Exception $e) { \OCP\Util::logException('base', $e); |