Also known as DOM storage
client-side data storage in web browsers
HTML Standard
html.spec.whatwg.org →The first is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transactions in different windows at the same time. To address this, this specification introduces the sessionStorage getter. Sites can add data to the session storage, and it will be accessible to any page from the same site opened in that window. If the user had multiple windows opened on the site, each one would have its own individual copy of the session storage object. The second storage mechanism is designed for storage that spans multiple windows, and lasts beyond the current session. In particular, web applications might wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons. The localStorage getter is used to access a page's local storage area. The site at example.com can display a count of how many times the user has loaded its page by putting the following at the bottom of its page: The localStorage getter provides access to shared state. This specification does not define the interaction with other agent clusters in a multiprocess user agent, and authors are encouraged to assume that there is no locking mechanism. A site could, for instance, try to read the value of a key, increment its value, then write it back out, using the new value as a unique identifier for the session; if the site does this twice in two different browser windows at the same time, it might end up using the same "unique" identifier for both sessions, with potentially disastrous effects. [Exposed=Window] interface Storage { readonly attribute unsigned long length; DOMString? key(unsigned long index); getter DOMString? getItem(DOMString key); setter undefined setItem(DOMString key, DOMString value); deleter undefined removeItem(DOMString key); undefined clear(); }; Storage/getItem method of the Storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given Storage object.") Returns the current value associated with the given key, or null if the given key does not exist. Storage/setItem method of the Storage interface, when passed a key name and value, will add that key to the given Storage object, or update that key's value if it already exists.") Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. Throws a QuotaExceededError if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.) Dispatches a storage event on Window objects holding an equivalent Storage object. Storage/removeItem method of the Storage interface, when passed a key name, will remove that key from the given Storage object if it exists. The Storage interface of the Web Storage API provides access to a particular domain's session or local storage.") Removes the key/value pair with the given key, if a key/value pair with the given key exists. Dispatches a storage event on Window objects holding an equivalent Storage object. Storage/clear method of the Storage interface clears all keys stored in a given Storage object.") Dispatches a storage event on Window objects holding an equivalent Storage object. 4. For each remoteStorage of remoteStorages: queue a global task on the DOM manipulation task source given remoteStorage's relevant global object to fire an event named storage at remoteStorage's relevant global object , using StorageEvent , with key initialized to key, oldValue initialized to oldValue, newValue initialized to newValue, url initialized to url, and storageArea initialized to remoteStorage. The Document object associated with the resulting task is not necessarily fully active , but events fired on such objects are ignored by the event loop until the Document becomes fully active again. The supported property names on a Storage object
Excerpt from a page describing this subject · 40,000 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).