Fix: Redirección correcta al login usando URL absoluta
This commit is contained in:
@@ -24,7 +24,9 @@ function checkSession(): void
|
||||
validateSessionDomain();
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header('Location: /login.php');
|
||||
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
|
||||
header('Location: ' . $scheme . '://' . $host . '/login.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user