Ninjakreborn Posted November 1, 2006 Share Posted November 1, 2006 I have a login session.I am also creating a temporary session array$_SESSION['temp']['variable'] = "value";there are a lot of them, but I need to destroy them at a specific point, the entire array need's the be "cleansed" at a specific point, without removing any other sessions but the one's in that array.I would think session_destroy($_SESSION['temp']);would remove the entire array but it only takes 0 parameters. So that can't happen.For now how do I just destroy that one session array. Quote Link to comment Share on other sites More sharing options...
trq Posted November 1, 2006 Share Posted November 1, 2006 [code=php:0]$_SESSION = array();[/code] Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted November 1, 2006 Author Share Posted November 1, 2006 I know, how do you destroy a session array?as above? Quote Link to comment Share on other sites More sharing options...
trq Posted November 1, 2006 Share Posted November 1, 2006 Sorry...[code=php:0]$_SESSION['temp'] = array();[/code]Will empty the array. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted November 1, 2006 Author Share Posted November 1, 2006 ah it will.I didn't know that. Thank you, so it will overwrite it from a populated array, to an empty array.Thanks thorpe Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 1, 2006 Share Posted November 1, 2006 Or you could use unset $_SESSION['temp'] and it'll remove the whole $_SESSION['temp'] array. Quote Link to comment 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.