The DOM Storage (pronounced Dam Storage), also called the Web Storage, is the functional evolution of the existing cookie and you can bet that will be a common standard that will change many habits.
Currently being standardized, is emerging with HTML 5 and is now supported (in part) from Internet Explorer 8, Firefox and Safari 2 +.
Developers can use this technology to store data temporarily for a session or permanently for a domain, clients are compatible.
The data are stored with a structure to associative array, ie a set of pairs of names and values.
It is not in any way except a redundant use of cookies and Web Storage.
Here is a sample counter displays made with DOM Storage (tested and running on Internet Explorer 8, Firefox 3.5 and Safari 4):
You see this page <p> <span id="contatore"> an unknown number </ span> times. </ P>
<script>
/ / Create an object window.localStorage
/ / Which stores data permanently for a domain
var data = window.localStorage;/ / If the variable does not exist numeroVisualizzazioni initialized to 0
if (! dati.numeroVisualizzazioni) dati.numeroVisualizzazioni = 0;/ / Add 1 to counter current
dati.numeroVisualizzazioni = parseInt (dati.numeroVisualizzazioni) + 1;/ / Update the content of span
document.getElementById ('counter'). innerHTML = dati.numeroVisualizzazioni;
</ Script>
Compared to cookies, DOM Storage provides more functionality and development opportunities, which we see:
References for further information:
Surely there will be security issues that emerge with widespread use. But the potential for development of web applications will be very interesting.
What do you think?