on close delete variable from localstorage code example
Example 1: javascript localStorage clear items
localStorage.clear();//this clears the localStorage completely
Example 2: localstorage drop item
storage.removeItem(keyName);
localStorage.clear();//this clears the localStorage completely
storage.removeItem(keyName);