Dear friends,
I have a problem to which I can't find a solution because I can't locate exactly where the problem is
I found on the net an auth system
to login the user it uses the function
function user_login($username,$password)
if (mysql_result($result,0,'confirmed') == '1')
{
session_register('$username');
user_set_tokens($username);
$feedback .= $username.' - Welcome ';
return true;
}
for the logout it uses
function user_logout()
{
setcookie('username','',(time()+2592000),'/','',0);
setcookie('id_hash','',(time()+2592000),'/','',0);
}
and there is also the function.....
function user_set_tokens($username_in)
{
global $hidden_hash_var,$username,$id_hash;
if (!$username_in)
{
$feedback .= ' ERROR - User Name Missing When Setting Tokens ';
return false;
}
$username=strtolower($username_in);
$id_hash= md5($username.$hidden_hash_var);
setcookie('username',$username,(time()+2592000),'/','',0);
setcookie('id_hash',$id_hash,(time()+2592000),'/','',0);
}
the problem is that it logs me in but when trying to log out it doesn't.
the code for the log out page is
<?
include ("userauth.php");
$result = user_logout();
if (!$result)
{
echo "could not log you out";
echo mysql_error();
}
?>
all I get is .....could not log you out without any error messages.
Can you please help me?