I would install it where, if someone sends a request to "log out", he will automatically transfer them to the page with the message "successful logout". If the client tries to click the "Back" button or go to a restricted area, it will again ask for HTTP confirmation.
What I still know:
example.com/restricted/index.php:
<?php
session_start();
if(isset($_GET['logout']))
{
unset($_SESSION["login"]);
header("location: ../logout.php");
exit;
}
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || !isset($_SESSION["login"]))
{
header("HTTP/1.0 401 Unauthorized");
header("WWW-authenticate: Basic realm=\"Tets\"");
header("Content-type: text/html");
$_SESSION["login"] = true;
exit;
}
?>
example.com/logout.php, example.com/restricted/index.php?logout. , , HTTP- (???), (?), , .
, , : / , , login true... GET , logout.php... , , , , [login] .
PHP . , HTTP Basic SQL, meh. .
: MySQL, . MySQL PHP ()