var element = document.getElementById("temp");
if (sessionStorage.getItem("hello") === "world") {
  element.innerHTML = "sessionStorage is available";
} else {
  sessionStorage.setItem("hello", "world");
  element.innerHTML = "sessionStorage is NOT available";
}<span id="temp"></span>Currently this sessionStorage survives refreshes but doesn't survive tab/browser closure (as expected). However, it also survives "hard refreshes" (getting a fresh version of the page with all cache deleted; Ctrl+Shift+R or Cmd+Shift+R).
However I want it to be deleted after a hard refresh too. It should only survive normal refreshes.
How can I do that with sessionStorage? And if it is not possible, what are the possible alternatives?
