Category: 09. Storing Data In The Browser

  • JavaScript IndexedDB

    Now, let’s explore a much more powerful built-in database than localStorage: IndexedDB. It can have almost any value and multiple key types. Transactions are also supported for more reliability. Key range queries and indexes are supported by IndexedDB. Moreover, it can store a lot more data than the localStorage. As a rule, IndexedDB is used for offline…

  • JavaScript LocalStorage, SessionStorage

    LocalStorage and sessionStorage are web storage objects, allowing developers to save key-value pairs in the browser. The most interesting thing about them is that the data survives a page refresh and a full restart of the browser. Both of the storage objects include the same properties and methods: setItem(key, value) – keep the key/value pair. getItem(key) –…

  • Cookies: document.cookie

    In this chapter, we will cover one of the ways of storing data in the browser: cookies. Cookies are small data strings, stored directly in the browser. They are included in the HTTP protocol. As a rule, the web-server sets cookies with the help of a response Set-Cookie HTTP header. After that, the browser adds them to…