game scores, or anything else the server should remember. • Personalization User preferences, themes, and other settings. • Tracking Recording and analyzing user behavior. Using HTTP cookies - MDN Front-End Web
storage. getItem() Mengambil data dari web storage. removeItem() Menghapus data dari web storage berdasarkan key. clear() Menghapus seluruh data tanpa terkecuali. key() Mencari nama key yang tersimpan berdasarkan index-nya (urutan simpan). Front-End Web
Data hanya bertahan selama satu sesi halaman saja. Data hanya hilang melalui JavaScript atau menghapus Browser cache. Data hanya bertahan selama satu sesi halaman saja. Batas penyimpanan sebanyak 5MB. Batas penyimpanan sebanyak 5MB. Data tidak akan dikirim ke server. Data tidak akan dikirim ke server. Difference Between Two Web Storage Mechanisms Web Storage concepts and usage - MDN
Incognito modes - MDN Private windows, incognito mode, and similarly named privacy browsing options, don't store data like history and cookies. In private mode, localStorage is treated like sessionStorage. The storage APIs are still available and fully functional, but all data stored in the private window is deleted when the browser or browser tab is closed. Front-End Web