webguync Posted April 10, 2009 Share Posted April 10, 2009 how would I combine a logout link and session_destroy()? <? session_destroy() <a href="">Logout</a> ?> cannot figure out the best way to do it. Link to comment https://forums.phpfreaks.com/topic/153478-logout-link-using-session-destroy/ Share on other sites More sharing options...
runnerjp Posted April 10, 2009 Share Posted April 10, 2009 stick the session destroy on the logout.php page.. then add a redirect to the home page! Link to comment https://forums.phpfreaks.com/topic/153478-logout-link-using-session-destroy/#findComment-806380 Share on other sites More sharing options...
jackpf Posted April 10, 2009 Share Posted April 10, 2009 Lol sounds like a plan... Link to comment https://forums.phpfreaks.com/topic/153478-logout-link-using-session-destroy/#findComment-806389 Share on other sites More sharing options...
mrMarcus Posted April 10, 2009 Share Posted April 10, 2009 <a href="logout.php">logout</a> logout.php <?PHP session_start(); $_SESSION = array(); session_destroy(); //redirect here; ?> Link to comment https://forums.phpfreaks.com/topic/153478-logout-link-using-session-destroy/#findComment-806390 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.