From 8ffd517678aee9f49bf276b550d0dfc525f620c7 Mon Sep 17 00:00:00 2001 From: Zsombor Franczia Date: Fri, 12 Sep 2014 12:49:43 +0200 Subject: [PATCH] only clean the session variable if the user is not authenticated anymore --- integration/laraveladministrator.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/integration/laraveladministrator.php b/integration/laraveladministrator.php index d675d6b..195aa5b 100644 --- a/integration/laraveladministrator.php +++ b/integration/laraveladministrator.php @@ -81,8 +81,9 @@ static function runIntegration() { $iStartedTheSession = true; } - //clean and reset the session variable to read options correctly - $_SESSION['KCFINDER'] = array(); + if (!isset($_SESSION['KCFINDER'])) { + $_SESSION['KCFINDER'] = array(); + } //if this is a simple true value, user is logged in if ($hasPermission == true) { @@ -111,6 +112,10 @@ static function runIntegration() { } } + else { + //clean and reset the session variable + $_SESSION['KCFINDER'] = array(); + } //close the session if I started it if (isset($iStartedTheSession)) {