PillowPillow/ng2-webstorage

Often state is loaded from memory cache after recent session storage erase.

Opened this issue · 3 comments

Versions (please complete the following information):

  • NgxWebstorage: 7.0.1
  • Angular: 11.1.1

Describe the bug
After I logout from my application, and verify, in Chrome's DevTools, that the session storage fields are indeed cleared as expected, some of the annotated fields (@sessionStorage) still return the previously saved value.

I changed some of those to SessionStorageService and the problem gets resolved, which indicates the bug is there only on the annotated fields.

To Reproduce
I did not create a sample.

Screenshots
Screen Shot 2021-02-01 at 09 18 15

Desktop (please complete the following information):

  • OS: MacOS 11.1
  • Browser chrome
  • Version 88.0.4324.96

Additional context
Add any other context about the problem here.

Reported previously in issue #107 by someone else, with my recent comments.

Update: I added code to fully reboot angular after logout. This was important for my app, among others, for security reasons, but also state reset, so services would not keep state from the previous login (see https://stackoverflow.com/questions/43234416/resetting-angular-2-app).
Although that fixed some app issues, this particular bug did not get fixed with the new code.

Decided to fully reload the page upon logout, which is a good idea anyway.
This fixes my problem but the bug is still a bug, so I leave the bug open.

Ran into the same issue.
The value is still returned after clearing.