Reputation: 4349
I'd like to clear a specific session, how would I go about doing that.
$_SESSION['files'][]
Upvotes: 4
Views: 3491
Reputation: 78971
On addition to above answers, you can remove multiple session variables at once.
unset($_SESSION['file'],$_SESSION['image'],$_SESSION['video']);
Upvotes: 3
Reputation: 400952
You could unset the entry you want to remove :
unset($_SESSION['files']);
This will completely remove the 'files'
entry from the $_SESSION
array.
Upvotes: 5
Reputation: 125476
if you want to unset all the array is :
unset ($_SESSION['files']);
if you want only specific entry to unset is
unset ($_SESSION['files'][entry]);
Upvotes: 9