qkhckgxhp qkhckgxhp - 4 months ago 10
Javascript Question

Clearing localstorage

What are the ways to clear the

localStorage
from the user-side and from the website-side?

For the website-side I found the "
localStorage.clear()
", but I can't find out if it clears all the localStorage or specifically for the same domain.

As for the user-side, I simply couldn't find any info. about it.

Thanks in advance!

Answer

localStorage is per domain/origin.

Clear it with code using localStorage.clear()

Clear it with the browser as you clear cookies/cache.


Further reading: