<?php
session_start();

if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['items_data'])) {
    $_SESSION['current_items'] = json_decode($_POST['items_data'], true) ?: [];
    echo "Items saved to session successfully";
} else {
    echo "Invalid request";
}
?>