HTML5 Local Storage

Why Trust Techopedia

What Does HTML5 Local Storage Mean?

HTML5 local storage is a component of the Web storage application programming interface. It is a method by which Web pages locally store named key/value pairs inside a client’s Web browser. Similar to cookies, this saved data exists – even when you close a browser tab, surf away from a current website, exit a browser tab or close a main browser. Unlike cookies, this data is not carried to the remote Web server unless it is sent manually. Because HTML5 local storage is natively integrated into Web browsers, it is available without third-party browser plug-ins. It is described in the HTML5 specifications.

Advertisements

Local storage is mainly used to store and retrieve data in HTML pages from the same domain. Even after restarting a browser, the data can be recovered from all windows in the same domain. This type of storage offers numerous options for Web apps.

Browsers, such as Firefox 3.5+, Internet Explorer 8.0+, Chrome 4.0+, Safari 4.0+, Mobile Safari (iPhone/iPad), Opera 10.5+ and Android 2.0+ support HTML5 local storage.

Techopedia Explains HTML5 Local Storage

HTML5 local storage is structured on named key/value pairs, unlike other databases that make use of SQL-intense applications. Data is stored based on a named key. After that, data may be retrieved using the same key. The named key is in a string format. The data may be of any type supported by JavaScript, such as Booleans, strings, floats or integers. Even so, the data is generally saved as a string. If users store and retrieve anything other than strings, they must make use of functions, such as parseFloat() or parseInt(), to coerce the recovered data to the expected JavaScript datatype.

From the JavaScript code, HTML5 local storage may be accessed through a localStorage object on the global window object. The localStorage object stores the data without any expiration date. The data is not wiped, even after closing the browser, and may be accessed at any time. Because it is client-side, stored data is based on the browser that is used.

Advertisements

Related Terms

Margaret Rouse
Technology Specialist
Margaret Rouse
Technology Specialist

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ??a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.

',a='';if(l){t=t.replace('data-lazy-','');t=t.replace('loading="lazy"','');t=t.replace(/