The following files exists in this folder. Click to view.
check_login.php14 lines UTF-8 Unix (LF)
<?php
session_start();
// Kolla om användaren är inloggad via session eller cookie
if (
(!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) &&
(!isset($_COOKIE['logged_in']) || $_COOKIE['logged_in'] !== 'true')
) {
// Om inte inloggad, skicka tillbaka till index.php
header('Location: index.php?error=2');
exit;
}