Access a variable on a Site tab from within a Page

Well, I gave up trying to get code on the Site tab to work. Instead, I created a pageNavigation.js file in the /public folder with currentPage() and previousPage() functions (which set and get the session variables. Then I simply invoke these functions on every page where I need to know how the user got to that page. This works.