Currently, I am utilizing the code
window.localStorage.removeItem("name of localStorage variable you want to remove");
to eliminate two distinct localStorage Keys within a particular specification, and it is successfully removing them.
Afterwards, I proceed to navigate to another section of my application where a dialog should appear prompting me to log in again due to session expiration. Strangely, when using Protractor to automate this process, the dialog does not show up even though the localStorage keys are correctly cleared. However, manually deleting the keys by right-clicking and selecting "Delete" triggers the dialog to surface as expected.
What do you think might be causing this issue? Any insights are appreciated.