Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Feb 17th, 2006, 11:43 AM   #1
anarki
Newbie
 
Join Date: Oct 2005
Posts: 5
Rep Power: 0 anarki is on a distinguished road
http auth logout

Hi, here i am with another question ...
This time http auth, more specific the logout of an applicacion logged by this code:

$auth = false;

if (isset($_SERVER['PHP_AUTH_USER']) &&
isset($_SERVER['PHP_AUTH_PW'])) {

$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
$oMember->Set('username', $username);
$oMember->Set('password', $password);

$results = $oMember->SearchUser();
$number = count($results);
if($number != 0) {
$auth = true;
}
}
if(!$auth) {
header('WWW-Authenticate: Basic realm="My Auth"');
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;
}
else {
echo 'Welcome ...';
$_SESSION['member_username'] = $username;
$_SESSION['member_password'] = $password;
echo "<meta http-equiv=\"Refresh\"content=\"2; URL=index.php?order=title\">";
}

I cant make a working code for logout.
In my best approachs the login windows appears again on the screen and when i hit enter the user loggout.
The other approach that i am using rigth now is a javascript function who closes the browser.

I need a clean logout for my users, any help will be appreciated.

Thanx.
anarki is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:29 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC