View Full Version : How to clear the data inside session variables?

06-27-2005, 04:44 AM
guys, how am i going to clear data inside session variables?
in every page, i put a


so i will be able to access the data that I stored inside the session variables.
Now what I want to have a "RESET" function (button, link, etc) that will
clear the data inside the session variables.

I tried using a "RESET" link inside "home.php"
<a href = "reset.php">RESET</a>

inside "reset.php"..
header('home.php'); // this is the page where I initialize the session

inside "home.php"..
.. // some code where I store data inside the session
<a href = "reset.php">RESET</a> // reset link

What do you think guys? I closed the session and started it again? I should get a session different from the previous one, right?

06-27-2005, 04:55 AM
foreach($_SESSION as $key=>var)

ALSO, it is session_start and session_close. Underscore, not a period.