I want to know how to be able to log out a user from a basic realm. Some users are unable to log out even when they completely restart their system... I know this has partially to do with the browser. but does PHP provide a tool to allow me to add a "logout" button that will at least work with most browsers?
I have already tried sending a HTTP/1.0 401 Unauthorized header, to no avail. Maybe I'm doing something wrong... here is the code I use:
<?
if ($logout=='true') {
header( "WWW-authenticate: basic realm='My Realm'");
header( "HTTP/1.0 401 Unauthorized");
header("Location: http://www.myserver.com/thisfile.php");
exit;
}
?>
of course, the value of $logout is 'true' upon reaching this, and upon attempting to access the realm, the browser does not prompt for a login. Is this the only way to log out a user?