I'm using SessionStorage to store private contextual information needed for my frontend application. I have noticed that sometimes when navigating away to a different website (different domain, part of the application flow) and coming back again, the session storage is not the way I left it. Sometimes there is nothing, sometimes a couple of properties still remain.
I have seen this happen on Chrome incognito on Windows, and Safari private browsing mode. For Safari, I can detect private browsing and fall back on session cookies, however these will be pointlessly passed over the network so I don't want to make this my main solution. Also I can only detect it for Safari and not for Chrome.
I cannot find any articles stating this is expected behaviour. The fact that it does not always occur makes it even more fun to debug.
Is there a way to reliably use SesionStorage? Or are there any suggested alternatives for storing this sensitive information in a secure way?