Cannot remove localStorage or sessionStorage


#1

Hi all.
I’m using localStorage to save username when user login. But why i cant remove or delete it?
i try to use $localStorage.$reset(); or window.localStorage.removeItem("display_name"); and window.localStorage.clear();

but the username still shown in my console on Chrome.
Is somebody could help me?
Thank you


#2

I would suggest using this https://github.com/jmdobry/angular-cache it allows you to cache into localStorage and manages all your cache keys.

How are you initially setting the item?