This question already has an answer here:
EDIT: Sorry about the title- I meant "before I attempt to unset it".
I want to destroy a specific session cookie, so I do so like:
unset($_SESSION['name']);
...but the user may or may not have that session set. So, should I be checking to see if it exists first, or does unset()
take care of that for me without errors?
if (isset($_SESSION['name'])) {
unset($_SESSION['name']);
}
</div>