How to delete Web Storage?

Storing sensitive data on local machine could be dangerous and could leave a security hole. The Session Storage Data would be deleted by the browser immediately after the session gets terminated.

To clear a local storage setting you would need to call localStorage.remove('key'); where 'key' is the key to the value you want to remove. If you want to clear all settings, you need to call localStorage.clear() method.


   
      
      

Refreshing the page would not to increase hit counter.

     

Close the window and open it again and check the result.

   
Updated on: 2020-01-28T08:11:29+05:30

339 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements