This commit is contained in:
2024-10-17 13:51:49 -04:00
parent ba7eef5499
commit e55dc42068
26 changed files with 635 additions and 0 deletions

22
includes/authcheck.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
// Secure session settings
ini_set('session.cookie_httponly', 1);
ini_set('session.cookie_secure', 1);
ini_set('session.use_strict_mode', 1);
session_start();
function isAuthenticated(): bool {
if (isset($_SESSION['authenticated']) && $_SESSION['authenticated'] === true) {
return true;
} else {
return false;
}
}
// Usage
if (!isAuthenticated()) {
header('Location: /login');
exit();
}