Im trying to delete an item from a session shopping cart. I used unset(), but somehow it didn't work
Link
<td width="100"><a href="?id=<?php echo $ids;?>&action=delete">
<?php echo $ids;?></a></td>
Unset
if(isset($_GET['action'])&&($_GET['action']=="delete"))
{
$new_id=$_GET['id'];
unset($_SESSION['items'][$new_id]);
}
session_start()before you try and unset the session var. B: ensure that the structure of your session data matches what you're trying to unset, and debug the$_GET['id']variable you're trying to use.session_write_close();.