From cde93c68dcc210ba0656b2d82af6a58c074bd50c Mon Sep 17 00:00:00 2001 From: Art4 Date: Tue, 19 Nov 2024 07:46:52 +0000 Subject: [PATCH] Fix session factory --- src/Core/Session/Factory/Session.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Core/Session/Factory/Session.php b/src/Core/Session/Factory/Session.php index d8d6273de9..734e34efa6 100644 --- a/src/Core/Session/Factory/Session.php +++ b/src/Core/Session/Factory/Session.php @@ -76,15 +76,21 @@ class Session default: $handler = null; } - - $session = new Native($baseURL, $handler); - } catch (Throwable $e) { $logger->notice('Unable to create session', ['mode' => $mode, 'session_handler' => $session_handler, 'exception' => $e]); $session = new Memory(); - } finally { $profiler->stopRecording(); return $session; } + + try { + $session = new Native($baseURL, $handler); + } catch (Throwable $e) { + $logger->notice('Unable to create session', ['mode' => $mode, 'session_handler' => $session_handler, 'exception' => $e]); + $session = new Memory(); + } + + $profiler->stopRecording(); + return $session; } }