freakymitra Posted January 10, 2011 Share Posted January 10, 2011 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 :-\ :-\ Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 10, 2011 Share Posted January 10, 2011 What is the actual message that is displayed? $HTTP_GET_VARS has been deprecated since PHP 4.1.0, BTW. Quote Link to comment Share on other sites More sharing options...
freakymitra Posted January 14, 2011 Author Share Posted January 14, 2011 No error is displaying. it just keep me login even if open the page in new window or clear the page cache.. Thanks for reply Quote Link to comment Share on other sites More sharing options...
revraz Posted January 14, 2011 Share Posted January 14, 2011 Where are you checking to see if they are logged in? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.