Alfons Marklén Alfons Marklén - 14 days ago 5
PHP Question

$_SESSION['x'] exist after session_unset(); and session_destroy(); How to remove?

How do I make sure that all

$_SESSION
is removed. I have a page with

<?php
session_unset();
session_destroy();
header("Location: threads.php");
?>

Answer

You must load/start the session before you can destroy it:

<?php
session_start();
session_destroy();
Comments