SSL and Sessions

Viewed 39

Do SSL and sessions have something to do with each other? Before I got an SSL certificate, all the sessions were working fine. However, when I try to log in to the admin page, the sessions are not getting updated, and I cannot log in. How can I fix it?

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $LogUser = $_POST['user'];
    $LogPass = $_POST['pass'];
    if ($LogUser == 'ADMIN' && $LogPass == 'password') {
        $_SESSION["admin"] = true;
        $_SESSION["admin_logged_in"] = true;
        echo '<script>window.location.href="./index.php"</script>';
    } else {
        echo '<div class="alert alert-danger container my-5" role="alert">
    Incorrect Username or Password
  </div>';
    }
}
0 Answers
Related