SUMMARY. When I test the sessionStorage object (window.sessionStorage) in Firefox I find that its contents persist during a system restart. This is a problem for my client who needs to comply with data protection law.
DETAIL. I tested this as follows:
(a) I added a myName property with value Catalina to window.sessionStorage in a Firefox tab on my browser. ( actually I tested this for both a locally saved HTML file and an HTML file accessed from a remote web server - and obtained the same result in each case.)
(b) I restarted the machine (Windows 10).
(c) I launched Firefox.
(d) I right-clicked at the top of Firefox and selected Re-open closed tab.
(e) I went to the inspector console and and inspected the contents of window.sessionStorage: astonishingly, window.sessionStorage.myName was still there and still contained the value Catalina!
Now, according to all the articles I can find on the web, this should not happen. Every article I have found states that sessionStorage does not persist during closure of the (entire) web browser and certainly does not persist during a system restart; this is in contrast to localStorage, which does persist during both of these activities.
BACKGROUND. I have implemented sessionStorage on this business's webpage because their clients are very security-conscious, so I wanted to reduce the amount of time that the data is stored to a minimum. The data concerned is the contents of an order page (quantities, prices, contact details, and card details) and I have implemented sessionStorage to make sure that all the fields get re-populated correctly after the user clicks on submit, gets their payment declined, and back-arrows to the payment page. Without using sessionStorage, I have found it difficult to control this re-population for all the web browsers.
Imo this behaviour by Firefox presents a significant data protection and security risk, which is not widely understood.
NOTES
Based on my testing, Chrome and Edge appear to be working correctly, ie the contents of sessionStorage do get deleted on closing the web browser or restarting the machine.
I am aware of the Stackoverflow discussion here https://stackoverflow.com/questions/5141331/firefox-3-6-sessionstorage-persists-between-browser-sessions. However, I don't think this answers my question. I am looking for a way to save data on the user's machine that persists, at most, through the closing of a tab and will not persist during the closing the web browser (or machine). However, it doesn't seem to be possible for cases where my clients' visitors are using Firefox.