ragrim Posted December 4, 2011 Share Posted December 4, 2011 Hi, I have 2 sessions in use, 1 for my login/authhentication and 1 for my cart, when an order is placed i want to empty the cart session, ive done some reading and session_destroy() seems to be the way im suppose to do this but when i do it destroys my login session so i have to relogin, is there any other way to just empty a session? i have tried session_destroy('cart') but doesnt seem to do anything. Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/252474-emptying-a-session/ Share on other sites More sharing options...
Pikachu2000 Posted December 4, 2011 Share Posted December 4, 2011 $_SESSION['cart'] = array(); Quote Link to comment https://forums.phpfreaks.com/topic/252474-emptying-a-session/#findComment-1294435 Share on other sites More sharing options...
ragrim Posted December 4, 2011 Author Share Posted December 4, 2011 Thank you for the quick response, that works perfect! Quote Link to comment https://forums.phpfreaks.com/topic/252474-emptying-a-session/#findComment-1294437 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.