Replace basic auth with PHP session login

This commit is contained in:
hbrain 2026-05-25 22:31:46 +02:00
parent d088eb90cf
commit 2ffb90d17e
4 changed files with 89 additions and 8 deletions

View file

@ -1,12 +1,6 @@
<?php
$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
setcookie('mvlog_realm', bin2hex(random_bytes(8)), [
'expires' => time() + 31536000,
'path' => '/mvlog',
'secure' => $secure,
'httponly' => true,
'samesite' => 'Lax',
]);
require __DIR__ . '/auth.php';
mvlog_logout();
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Location: index.php');
exit;