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 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 20:18:23 +00:00
parent 6e86031576
commit 935b838c8f
+4
View File
@@ -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
*/