I'm using HTTP authentication to require a user to type a User ID and password.
if (!isset($_SERVER['PHP_AUTH_USER'])) {
// bunch of header authentication commands and structures here
}
else {
// id and/or password is invalid
}
My problem is: The only way to log out is to close all of the browser windows. I want the user to be able to log out without having to close all of the browser windows.
Since the script is checking to see whether or not the user id variable is set, is there a way to unset it?
unset($_SERVER['PHP_AUTH_USER']);
didn't work.
I also tried to put ($_SERVER['PHP_AUTH_USER']) into a variable, and unset the variable. That didn't work either. Help😕