localStorage

localStorage stores string values for an origin so they can be read after a later visit.

localStorage.setItem('theme', 'dark'); const theme = localStorage.getItem('theme');

Use it for small non-sensitive preferences such as a theme choice. It is not a secure store for passwords or tokens.