Saturday, February 26, 2022

New Functionality: Session Storage interaction

Just added to BASIC Anywhere Machine:

  • SetSessionStorageItem(key, value)
  • GetSessionStorageItem(key)

Sample BASIC program:

SetSessionStorageItem ("salutation", "howdy, buddy")
Print GetSessionStorageItem ("salutation")
SetSessionStorageItem (1, 5)
Print GetSessionStorageItem (1)


Please take the following with a grain of salt, as this is my recently acquired understanding based on what I've read (experience-based understanding is pending!):

Difference between these and the "LocalStorage" counterparts:

  • LocalStorage is persistent (i.e. will still be available after browser/computer restart) and shared among all "same site" web pages across open same-browser instances and browser tabs
  • SessionStorage is temporary and only persistent in the current browser tab's access to a web page (close the tab or navigate to some other website, and temporary storage is gone.)

More info to follow as I slowly wrap my mind around practical uses cases for one vs the other.

Cheers !

No comments:

Post a Comment

🖥 Flower Tesselation: Testing DRAW and recursive SUB's

This BAM program inspired by Richard Russell's "Flower-like tesselation" BBC BASIC program posted on Facebook . I did not get ...