PillowPillow / ng2-webstorage

Localstorage and sessionstorage manager - Angular service
MIT License
428 stars 92 forks source link

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

Open rsivan opened 3 years ago

rsivan commented 3 years ago

Versions (please complete the following information):

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):

Additional context Add any other context about the problem here.

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

rsivan commented 3 years ago

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.

rsivan commented 3 years ago

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.

chandrn commented 2 years ago

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