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) Link to comment https://forums.phpfreaks.com/topic/29916-session_destroy/ 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 Link to comment https://forums.phpfreaks.com/topic/29916-session_destroy/#findComment-137425 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] Link to comment https://forums.phpfreaks.com/topic/29916-session_destroy/#findComment-137428 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 Link to comment https://forums.phpfreaks.com/topic/29916-session_destroy/#findComment-137436 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] Link to comment https://forums.phpfreaks.com/topic/29916-session_destroy/#findComment-137442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.