xyn Posted September 20, 2006 Share Posted September 20, 2006 Hey Guys.I basically need some help in deleting 3 sessions.I dont want to kill ALL sessions because the Memberswill be logged out of the area and every other sessionused will be killed.my sessions are...[code=php:0]$_SESSION['FieldDept']$_SESSION['FieldName']$_SESSION['FieldMail'][/code] Quote Link to comment https://forums.phpfreaks.com/topic/21422-killing-sessions-some-not-all/ Share on other sites More sharing options...
wildteen88 Posted September 20, 2006 Share Posted September 20, 2006 Use unset, eg[code=php:0]unset($_SESSION['var_name']);[/code]If you wnat to delete the session data for fieldDept, fieldName, fieldMail then you can do this:[code=php:0]unset($_SESSION['FieldDept'], $_SESSION['FieldName'], $_SESSION['FieldMail']);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21422-killing-sessions-some-not-all/#findComment-95396 Share on other sites More sharing options...
xyn Posted September 20, 2006 Author Share Posted September 20, 2006 thx :] Quote Link to comment https://forums.phpfreaks.com/topic/21422-killing-sessions-some-not-all/#findComment-95399 Share on other sites More sharing options...
Daniel0 Posted September 20, 2006 Share Posted September 20, 2006 To unset all session variables you can use [url=http://php.net/session_unset]session_unset()[/url]. Quote Link to comment https://forums.phpfreaks.com/topic/21422-killing-sessions-some-not-all/#findComment-95419 Share on other sites More sharing options...
Ninjakreborn Posted September 20, 2006 Share Posted September 20, 2006 It doesn't kill all sessions for all user's sessions are user specific.If user a logs in, and it registers a bunch of sessions, and 4 other people login 2, and oen logs out, and it takes them to 1 page that has nothing but[code]<?phpsession_destroy();header("Location: index.php");?>[/code]The session file associated with that one user is erased, all the others are left alone. Quote Link to comment https://forums.phpfreaks.com/topic/21422-killing-sessions-some-not-all/#findComment-95444 Share on other sites More sharing options...
wildteen88 Posted September 20, 2006 Share Posted September 20, 2006 Umm, xyn wnated to delete a couple of session variables. Not a whole session. Quote Link to comment https://forums.phpfreaks.com/topic/21422-killing-sessions-some-not-all/#findComment-95463 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.