TLDR: sessionStorage data survives a page reload.
Probably many here already knew about this, but I was glad to find out about so I thought I’d post it.
I have a referral marketing program. If a new user comes in via a referral marketing code, the app stores the code in application state. Then if the user creates a new account, the code is saved to their new account, so people can get their referral fees. This all works as expected.
Now let’s say a new user comes in via a referral marketing code. Their code is saved to application state. Then to create their new account, this particular user reloads the page to activate their password manager. Application state is lost.
I had to find a way to save the code across page reloads.
And, sessionStorage does that.