I'm not an expert, as I've just started using this software, but I've figured out how to save data using the webstorage object.
Right click on your layout and select "Insert new object." Under "Data & Storage" select the webstorage object.
Add a new "System > On start of layout "event to your event sheet.
On the System event, right click to the left of the word System. Select "Add sub-event."
Select "Webstorage > Local key exists." Click next then type any name you want to reference the stored object. (Use "test" for example.)
Click on add action, select Webstorage > Set local value.
For the key name, use the name you used above ("test")
Enter the variable value.
Once this is done, right click "local key "test" exists and select invert.
Now copy this event and paste the copy under the original. Remove the "invert" on the second event.
There may be an easier or better way to do this, but this is how I got it to work.