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; } }