Anders Moen Posted January 4, 2007 Share Posted January 4, 2007 How do I destroy a session? When i go to my login page, I log in, and then it takes me to the index and from there I click log out and I get to the log out page. And from there I get redirected back to the index where I go to the login page again, and I'm still loged on Link to comment Share on other sites More sharing options...
ms_dos10 Posted January 4, 2007 Share Posted January 4, 2007 Hello You're question not clear to get what you wanna do , but i hope u wanna this <?phpob_start();session_start();if($_SESSION['sessref']){//echo "my name is : dolib"; $_SESSION = array(); session_unset(); session_destroy(); header("location:admincp.php"); exit();}ob_end_flush();?> and if you know Arabic tell me Link to comment Share on other sites More sharing options...
reportingsjr Posted January 4, 2007 Share Posted January 4, 2007 You know, this is all you have to do: <?phpsession_destroy();?> You dont need all of that other code.. Link to comment Share on other sites More sharing options...
Executer Posted January 4, 2007 Share Posted January 4, 2007 If you are making a registratation system: <?phpsession_start();session_destory();session_unset();?> but if you are only trying to destory the session, use session_destory(); Link to comment Share on other sites More sharing options...
Executer Posted January 4, 2007 Share Posted January 4, 2007 If you are making a registratation system: <?phpsession_start();session_destory();session_unset();?> but if you are only trying to destory the session, use session_destory(); Link to comment Share on other sites More sharing options...
Anders Moen Posted January 5, 2007 Author Share Posted January 5, 2007 Thanks guys, but I found out right after I posted this post. And I didn't have time to tell that I found out.I just used<?phpsession_start();session_destroy();?>at the logout page. Hehe, thanks anyway Link to comment Share on other sites More sharing options...
Executer Posted January 5, 2007 Share Posted January 5, 2007 Recommandation:Use session_unset(); after the session_destory(); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now