Log out problem from a website ???

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Log out problem from a website ???

Post by szms »

Hi there....

I used UNIX htaccess for Log in to my web page. Inside my code I use MYSQL with PHP but everytime I closed the seeion for MYSQL.

Now my goal is to logo out from unix server and once I do that no matter how many same web page I have open will be logged out or inactive as for example in hotmail accout if you do log out once you cannot have access for the other hotmail window if there is any open one. I am using following code but it's not working. Please have a look and help me.....

Thank you.

Code: Select all

<html>
<head>
<title>
</title>
</head>
<body>
<?php
function logoutFromHTTP()
&#123;
unset($_SERVER&#1111;'PHP_AUTH_USER']);
unset($_SERVER&#1111;'PHP_AUTH_PW']);
&#125;


logoutFromHTTP();

print "Logout Successfull";
?>
</body>
</html>
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

the use of a .htaccess file is an Apache (web server) feature, not UNIX.

HTTP authentication is the web browser sending the user/pass to the webserver for every single page request, and PHP can not alter this. Changing anything in $_SERVER is meaningless since the webserver never reads anything from it, it is only written to by PHP from the webserver environment variables before the script execution starts.

Some apps do have workarounds, such as Neomail, I dont know exactly what they do but I assume sending some specific headers to the client, but, this only works for a few browsers such as IE, it does not work for Mozilla/Netscape..
Post Reply