also clear browser basic auth via additional fhclogout cookie in private/logout.php

This commit is contained in:
Harald Bamberger
2025-09-10 07:51:09 +02:00
parent 5889bdb6ea
commit 14d49d87b3
2 changed files with 36 additions and 1 deletions
+2 -1
View File
@@ -72,6 +72,7 @@ class Auth extends FHC_Controller
{
$this->load->library('AuthLib');
$this->authlib->logout();
redirect('/Cis/Auth/login', 'refresh');
setcookie('fhclogout', 'fhclogout', 0, '/');
redirect(base_url('/cis/private/logout.php'), 'refresh');
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
require_once('../../config/cis.config.inc.php');
if (isset($_COOKIE['fhclogout']) && ($_COOKIE['fhclogout'] === 'fhclogout'))
{
setcookie('fhclogout', '', -1, '/');
http_response_code(401);
header('WWW-Authenticate: Basic realm="' . AUTH_NAME . '"');
?>
<!doctype html>
<html>
<head>
<title>FH-Complete logout Basic Auth</title>
<meta http-equiv="refresh" content="2; url=<?php echo APP_ROOT . 'cis/'; ?>"/>
</head>
<body>
<script>
function logout()
{
console.log('FH-Complete logout Basic Auth');
window.location.href = '<?php echo APP_ROOT . 'cis/'; ?>';
}
logout();
</script>
</body>
</html>
<?php
}
else
{
http_response_code(303);
header('Location:' . APP_ROOT . 'cis/');
}