Replace basic auth with PHP session login
This commit is contained in:
parent
d088eb90cf
commit
2ffb90d17e
4 changed files with 89 additions and 8 deletions
10
logout.php
10
logout.php
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue