$_SESSION['cart'][$product_id] = $new_qty; else $_SESSION['cart'][$product_id] = $quantity;
A secure URL should look like: POST /add-to-cart (not GET) with body product_id=123&quantity=1 . add-cart.php num