diff --git a/docs/common/header.php b/docs/common/header.php index 9a51045..2d3a369 100755 --- a/docs/common/header.php +++ b/docs/common/header.php @@ -6,8 +6,11 @@ include_once("config.php"); // Include utils to have access to custom classes include_once("utils.php"); -// Start session -session_start(); +// If the session cookie is set, start session +if(isset($_COOKIE["PHPSESSID"])) +{ + session_start(); +} // PDO Mysql connection object $conn = null; diff --git a/docs/www/login.php b/docs/www/login.php index 3112188..ed5f190 100644 --- a/docs/www/login.php +++ b/docs/www/login.php @@ -93,10 +93,11 @@ function attempt_login($conn, $username, $password) { } /** - * If user sent the form, process it. + * If user sent the form, process it. This starts a session. * Either login user and redirect to index or set error message variables. */ if (isset($_POST["submit"])) { + session_start(); // Log user out $_SESSION["current_user"] = null; // Attempt to log in