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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.