I tried the following code:
<?php
header("WWW-Authenticate: Basic realm=\"My Realm\"");
header('status: 401 Unauthorized');
print "Logout Successfull";
?>
Now I am getting a the same window for filling up the user id and password that I got first to log in to my web site as I used .htaccess file in side the MainPage directory.
And if I press cancel it's giving me:
Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
If I press ok without inputting any thing it gives me:
"Logout Successfull"
Even I tried to fillup the user ID and password and press ok it gives me "Logout Successfull". I assume it's asking me the same user ID and Password that I used for the first login to for .htaccess file.
But I don't want none of the above situations.
Let me tell you my goal. I think that might help you to understand what I really want to do.
I want to use some php code that will log me out from this web site and no matter how many pages are open from the same web sire (Those will be inactive). I mean you have to login again to get atarted again. Just think about hotmail. If it has open several pages from same user account. If you logout one of the page the others are required t olog in again on order to do something.
Hope you understand. Plese let me know your advice.