13 lines
499 B
PHP
13 lines
499 B
PHP
<?php
|
|
error_log("--- auth-check.php: Start ---");
|
|
error_log("auth-check.php: Session status: " . session_status());
|
|
error_log("auth-check.php: Session ID: " . session_id());
|
|
error_log("auth-check.php: Checking for user_id in \$_SESSION: " . print_r($_SESSION, true));
|
|
|
|
if (!isset($_SESSION['user_id'])) {
|
|
error_log("auth-check.php: user_id NOT SET. Redirecting to login.php");
|
|
header("Location: login.php");
|
|
exit;
|
|
}
|
|
error_log("auth-check.php: user_id IS SET. User is authenticated.");
|
|
?>
|