Base: Attempted fix for $_SESSION["data"] reported as missing

This is the fix suggested by user @guylior. The primary change is
moving the $_SESSION[“data”] definition below the main.js script
inclusion.