Отменить переменную сеанса php

Я передаю id ajax для удаления $ _SESSION. Часть ajax работает нормально, php получает в POST идентификатор, но доступный не может быть отменен. Зачем??? Вот мой код:

Часть ajax:

$(".delete").live('click', function(e){ e.preventDefault(); var id_to_remove = $(this).attr('id'); //alert(id_to_remove); $.ajax({ type: "POST", url: 'inc/functions/remove_item_from_cart.php', data: { id : id_to_remove }, success: function(data) { $("#content").load('inc/functions/get_checkout_content.php'); alert(data); } }) }); 

Получающая часть php:

 session_start(); if(isset($_SESSION['cart']) && isset($_POST['id'])){ //echo var_dump($_SESSION['cart']); $ncart=$_SESSION['cart']; if (count($ncart)>0){ unset($ncart[$_POST['id']]); // this is NOT working!!! $ncart=array_values($ncart); $_SESSION['cart']=$ncart; if(count($ncart)==0){ unset($_SESSION['cart']); unset($_SESSION['cart_total']); echo "all_empty"; } // this if part is the only working! } } с session_start(); if(isset($_SESSION['cart']) && isset($_POST['id'])){ //echo var_dump($_SESSION['cart']); $ncart=$_SESSION['cart']; if (count($ncart)>0){ unset($ncart[$_POST['id']]); // this is NOT working!!! $ncart=array_values($ncart); $_SESSION['cart']=$ncart; if(count($ncart)==0){ unset($_SESSION['cart']); unset($_SESSION['cart_total']); echo "all_empty"; } // this if part is the only working! } } с session_start(); if(isset($_SESSION['cart']) && isset($_POST['id'])){ //echo var_dump($_SESSION['cart']); $ncart=$_SESSION['cart']; if (count($ncart)>0){ unset($ncart[$_POST['id']]); // this is NOT working!!! $ncart=array_values($ncart); $_SESSION['cart']=$ncart; if(count($ncart)==0){ unset($_SESSION['cart']); unset($_SESSION['cart_total']); echo "all_empty"; } // this if part is the only working! } } с session_start(); if(isset($_SESSION['cart']) && isset($_POST['id'])){ //echo var_dump($_SESSION['cart']); $ncart=$_SESSION['cart']; if (count($ncart)>0){ unset($ncart[$_POST['id']]); // this is NOT working!!! $ncart=array_values($ncart); $_SESSION['cart']=$ncart; if(count($ncart)==0){ unset($_SESSION['cart']); unset($_SESSION['cart_total']); echo "all_empty"; } // this if part is the only working! } } 

Любое полезное предложение, почему я не могу отключить переменную сеанса? Благодаря!