zang8027 Posted February 3, 2009 Share Posted February 3, 2009 I got like 3 sessions running.. each holding important information. Is there a way to destroy a certain session, but not the others? session_destroy() would destroy all wouldnt it? I dont want to unset anything, i want to destroy it completely Link to comment https://forums.phpfreaks.com/topic/143690-clearing-a-certain-session/ Share on other sites More sharing options...
trq Posted February 3, 2009 Share Posted February 3, 2009 What exactly do you meen by 3 sessions? Link to comment https://forums.phpfreaks.com/topic/143690-clearing-a-certain-session/#findComment-753941 Share on other sites More sharing options...
zang8027 Posted February 3, 2009 Author Share Posted February 3, 2009 i got a session running if the user is logged in called SESSION['user']; Next, i got the shopping cart session that is called SESSION['cart']; Then i got SESSION['rest']; that holds rest ID on all the pages, which needs to be deleted if the user clicks "clear cart" not too good to have all of em i bet but it was the only way i could get this site to work the way it is :-/ Link to comment https://forums.phpfreaks.com/topic/143690-clearing-a-certain-session/#findComment-753942 Share on other sites More sharing options...
trq Posted February 3, 2009 Share Posted February 3, 2009 not too good to have all of em i bet but it was the only way i could get this site to work the way it is :-/ You can store whatever you like in your session. Its still only one session array though, you had me a little confused. All you need to is unset the array element your don't want. eg; unset $_SESSION['rest']; Link to comment https://forums.phpfreaks.com/topic/143690-clearing-a-certain-session/#findComment-753947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.