So I want to store some information in localstorage of a browser when the page is refreshed or the user exits the page for future use. I figured that I\'d use some Javascrip
I believe that Onbeforeunload is a safe bet. It is possible for browser to not execute onunload script completely - for example, if you have alert in onunload, chrome would not show if you close the window.