Fix: Redirección correcta al login usando URL absoluta

This commit is contained in:
2026-02-19 14:24:23 -06:00
parent a4960b90e8
commit b002982faa

View File

@@ -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;
}
}