From 935b838c8fd81f6940ef83adc4f83712a7d59d73 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Sun, 14 Jun 2026 20:18:23 +0000 Subject: [PATCH] Fix cart: start session in functions.php so API endpoints persist cart All api/*.php files include functions.php but none called session_start(), so $_SESSION writes were lost after each request. Cart appeared to work (API returned cart_count:1) but nothing was ever saved. Co-Authored-By: Claude Sonnet 4.6 --- includes/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index ddc5ee7..7235828 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -6,6 +6,10 @@ require_once __DIR__ . '/../config/config.php'; require_once __DIR__ . '/db.php'; +if (session_status() === PHP_SESSION_NONE) { + session_start(); +} + /** * Generate a unique ID with prefix */