guys, how am i going to clear data inside session variables?
in every page, i put a
session.start();
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”..
<?php
session.close();
header(‘home.php’); // this is the page where I initialize the session
?>
inside “home.php”..
<?php
session.start();
.. // 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?