Accurax Posted December 8, 2006 Share Posted December 8, 2006 I need to create a "log out" button for my website....... is it best to use session_destroy() or is there a better way?Also, if i am to use this, is it possible to have it activated by a simple text link, rather that a form ??Thanks guys(plenty of info around on logging in.... cant find a thing about logging out lol) Quote Link to comment Share on other sites More sharing options...
Accurax Posted December 8, 2006 Author Share Posted December 8, 2006 Ive created a really simple files.. as follows[code]<?phpsession_start();session_destroy();?>[/code]ive created a link from the members page called "log out"is this going to do the job properly??......... it seems to work Quote Link to comment Share on other sites More sharing options...
noobstar Posted December 8, 2006 Share Posted December 8, 2006 That's the best way i would say, kills the sessions permanently.Other then that there is only session_unset() that i can think ofHere is the link for the info: [url=http://www.php.net/manual/en/function.session-unset.php]http://www.php.net/manual/en/function.session-unset.php[/url] Quote Link to comment Share on other sites More sharing options...
Accurax Posted December 8, 2006 Author Share Posted December 8, 2006 i thought it was..... best to check though.... thanks matey Quote Link to comment Share on other sites More sharing options...
taith Posted December 8, 2006 Share Posted December 8, 2006 another way... kills all open sessioned variables without destroying the session itself. [code]$_SESSION=array();[/code] 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.