From 46adb3eced0386b97540947beb8c305efdc15175 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Sat, 19 Nov 2016 16:33:19 +0100 Subject: [PATCH] replace session implementation if it changes at runtime Signed-off-by: Christoph Wurst --- lib/private/Authentication/LoginCredentials/Store.php | 9 +++++++++ lib/private/Server.php | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/private/Authentication/LoginCredentials/Store.php b/lib/private/Authentication/LoginCredentials/Store.php index ea4c9fdd0c..17749c63b3 100644 --- a/lib/private/Authentication/LoginCredentials/Store.php +++ b/lib/private/Authentication/LoginCredentials/Store.php @@ -56,6 +56,15 @@ class Store implements IStore { $this->logger = $logger; } + /** + * Replace the session implementation + * + * @param ISession $session + */ + public function setSession(ISession $session) { + $this->session = $session; + } + /** * @since 9.2 * diff --git a/lib/private/Server.php b/lib/private/Server.php index 7c2d00e283..45ed9d5e3b 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1004,7 +1004,8 @@ class Server extends ServerContainer implements IServerContainer { */ public function setSession(\OCP\ISession $session) { $this->query(SessionStorage::class)->setSession($session); - return $this->query('UserSession')->setSession($session); + $this->query('UserSession')->setSession($session); + $this->query(Store::class)->setSession($session); } /**