I have created a Google Web App. It has 2 HTML pages that I can switch between using the principles described in this answer from Stack Overflow
Linking to another HTML page in Google Apps Script
The first HTML page calls a server side function. It returns data from a Google spreadsheet and assigns the data to a variable.
When a user switches to HTML page 2 the variable is lost and so when switching back to page 1 the script must call the server side function again, which takes a few seconds.
Is it possible to maintain the variable for the full session?
I've tried assigning it as as a global variable in the HTML files, as a global var in the .gs file, and passing it as a parameter in the URL but none of these seem to work.
I suspect it's not possible due to the nature of the apps script HTML service but you never know...