From d9f632da2622338ee6ca34cade9e8257a68dbafd Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Fri, 27 Dec 2024 02:28:03 +0100 Subject: [PATCH] Fix: check if the session is set before using it --- public/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index 749e178..74908f2 100644 --- a/public/index.php +++ b/public/index.php @@ -24,7 +24,7 @@ require_once models . 'Habit.php'; // Initialize router $router = new Router(); -if(!$_SESSION['user']) { +if(!isset($_SESSION['user'])) { $router->add('/', 'HomeController@index'); } else { $router->add('/', 'DashboardController@reroute', ['RequireAuth']);