AdRock Posted March 23, 2008 Share Posted March 23, 2008 Is it possible to destroy certain session? The thing is that I have sessions created when a user logs in and I also create a session to pass form values between pages. How can i destroy the session with the form values when i no longer need them Link to comment https://forums.phpfreaks.com/topic/97539-destroying-sessions/ Share on other sites More sharing options...
ohdang888 Posted March 23, 2008 Share Posted March 23, 2008 just To clear all values, it the first lines of the code would be... <?php session_start(); session_destory(); session_start(); ?> Link to comment https://forums.phpfreaks.com/topic/97539-destroying-sessions/#findComment-499061 Share on other sites More sharing options...
AdRock Posted March 23, 2008 Author Share Posted March 23, 2008 What if a user has logged in and sets a session, uses the form which sets another session and I want to destroy the second session, how would this be done without destroying the users login session? Link to comment https://forums.phpfreaks.com/topic/97539-destroying-sessions/#findComment-499066 Share on other sites More sharing options...
ohdang888 Posted March 23, 2008 Share Posted March 23, 2008 <?php unset($_SESSION['page1']); unset($_SESSION['page2']); unset($_SESSION['page3']); ?> Try that. Link to comment https://forums.phpfreaks.com/topic/97539-destroying-sessions/#findComment-499071 Share on other sites More sharing options...
AdRock Posted March 24, 2008 Author Share Posted March 24, 2008 Worked a treat...thanks Link to comment https://forums.phpfreaks.com/topic/97539-destroying-sessions/#findComment-499124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.