mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
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:
@@ -6,6 +6,10 @@
|
|||||||
require_once __DIR__ . '/../config/config.php';
|
require_once __DIR__ . '/../config/config.php';
|
||||||
require_once __DIR__ . '/db.php';
|
require_once __DIR__ . '/db.php';
|
||||||
|
|
||||||
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a unique ID with prefix
|
* Generate a unique ID with prefix
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user