I can only get XAMPP to work with PHP Sessions whenever the php.ini setting auto_start is set to 1. Does anyone know why this is?
; Initialize session on request startup.
; https://php.net/session.auto-start
session.auto_start=1
At the start of all my php pages I call session_start()
and initialise the variables:
if (!isset($_SESSION["basket"])) {
echo "Setting up array";
$_SESSION["basket"] = array();
}