<?php
session_start();

require_once '../../includes/auth.php';

if (!isset($_SESSION['cart'])) {
    $_SESSION['cart'] = [];
}

$itemId = isset($_GET['id']) ? (int)$_GET['id'] : 0;

if ($itemId <= 0) {
    exit('Invalid item');
}

if (isset($_SESSION['cart'][$itemId])) {
    unset($_SESSION['cart'][$itemId]);
}

echo 'success';
?>