Jump to content

Log out error.. please help


freakymitra

Recommended Posts

Hi Guys,

 

I got an error- when i click on logout button, it keeps showing log in. No actual logout happen.. Did i miss/incorrect anything in above code

 

Here is my bit code written in php

 

// User authentication

if($hduser['logged_in'] && empty($HTTP_GET_VARS))

{

// If user logged in, show message & redirect to index

die(dialog("You are already logged in.",

$page_title, "Index", "index.php", true, true));

}

 

//

// User logs out ----------------------------------------------------------------------------------------------------

//

if($_GET['action'] == "logout")

{

//

// Check if user logged in, if not show error

//

if(!$hduser['logged_in'])

{

die(dialog("You are not logged in.", $page_title, "Index", "index.php", true, true));

}

else

{

setcookie("hd_userdata", "", time()-36000);

die(dialog("You are now logged out.", $page_title, "Log In", "login.php", true, true));

}

}

#

 

 

 

Thanks in advance :-\ :-\

Link to comment
https://forums.phpfreaks.com/topic/223963-log-out-error-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.