jd2007 Posted July 16, 2007 Share Posted July 16, 2007 How to use session_unset to log out a user ? pls show me an example... Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/ Share on other sites More sharing options...
ToonMariner Posted July 16, 2007 Share Posted July 16, 2007 Alerady have done in your other thread! all you need is session_unset(); session_destroy(); put that code in side an if statement that checks if they clicked 'log out' or not.. Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/#findComment-299399 Share on other sites More sharing options...
rameshfaj Posted July 16, 2007 Share Posted July 16, 2007 Use like this: session_start(); $_SESSION['username']=""; Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/#findComment-299401 Share on other sites More sharing options...
tapos Posted July 16, 2007 Share Posted July 16, 2007 Romesh is right. If you use session_unset() function, this will not clean session files stored in the server. -- Tapos Pal Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/#findComment-299419 Share on other sites More sharing options...
jd2007 Posted July 16, 2007 Author Share Posted July 16, 2007 how to use php to check wheter a user has clicked a button ? Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/#findComment-299421 Share on other sites More sharing options...
jd2007 Posted July 16, 2007 Author Share Posted July 16, 2007 won't session_destroy clean the session files ? Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/#findComment-299422 Share on other sites More sharing options...
tapos Posted July 16, 2007 Share Posted July 16, 2007 Use form and go just like the rretrival process of other variable. //just like this echo $_POST['btn_submit']; or echo $_GET['btn_submit']; -- Tapos Pal Link to comment https://forums.phpfreaks.com/topic/60186-how-to-use-session_unset-to-log-out-a-user/#findComment-299423 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.