A better example of the solution Brian was suggesting [admins: please delete my previous post]
logout.php:
<?php
if (!isset($_GET['quit'])) { ?>
<h4>To complete your log out, please click "OK" then "Cancel" in
this <a href="logout.php?quit=y">log in box</a>. Do not fill in a
password. This should clear your ID and password from the cache of your
browser.
<blockquote>Note: Logging in from this particular box is
disabled!</blockquote>
<p>Go <a href="/">back to the site</a>.</h4>
<?php
} else {
header('WWW-Authenticate: Basic realm="This Realm"');
header('HTTP/1.0 401 Unauthorized');
// if a session was running, clear and destroy it
session_start();
session_unset();
session_destroy();
echo "<h3>Logged out!</h3><h4>Go <a href=\"/\">back to the site</a>.</h4>";
}
?>
Note: "This Realm" should be changed to precisely match the name of your realm in your main login.
Voting
The Note You're Voting On
notter at thisaddress dot com ¶
7 years ago
