<?php
header('Content-Type: application/json');
session_start();

$response = ['success' => false, 'items' => []];

if (isset($_SESSION['food_items'])) {
    $response['success'] = true;
    $response['items'] = $_SESSION['food_items'];
}

// Return response as JSON
echo json_encode($response);
?>
