- Web Storage
-
HTML - HTML and HTML5
- Dynamic HTML
- XHTML
- XHTML Mobile Profile and C-HTML
- Canvas element
- Character encodings
- Document Object Model
- Font family
- HTML editor
- HTML element
- HTML Frames
- HTML5 video
- HTML scripting
- Web browser engine
- Quirks mode
- Style sheets
- Unicode and HTML
- W3C and WHATWG
- Web colors
- Web Storage
- Comparison of
Web Storage and DOM Storage (Document Object Model) are web application software methods and protocols used for storing data in a web browser. Web storage supports persistent data storage, similar to cookies, as well as window-local storage.
Web storage is being standardized by the World Wide Web Consortium (W3C). It was originally part of the HTML 5 specification, but is now in a separate specification.[1] It is supported by Internet Explorer 8, Mozilla-based browsers (e.g., Firefox 2+, officially from 3.5),[2] Safari 4, Google Chrome 4 (sessionStorage is from 5), and Opera 10.50. As of 14 July 2010[update] only Opera supports the storage events.[3]
Contents
Features
Web storage can be viewed simplistically as an improvement on cookies, providing much greater storage capacity (5MB per domain in Mozilla Firefox,[4] Google Chrome, and Opera, 10MB per storage area in Internet Explorer[5]) and better programmatic interfaces. However, it differs from cookies in some key ways.
Client-side interface
Unlike cookies, which can be accessed by both the server and client side, Web storage falls exclusively under the purview of client-side scripting. Web storage data is not transmitted to the server in every HTTP request, and a web server can't directly write to Web storage, but can of course issue read and write requests.
Local and session storage
Web storage offers two different storage areas—local storage and session storage—which differ in scope and lifetime. Data placed in local storage is per domain (it's available to all scripts from the domain that originally stored the data) and persists after the browser is closed. Session storage is per-page-per-window and is limited to the lifetime of the window. Session storage is intended to allow separate instances of the same web application to run in different windows without interfering with each other, a use case that's not well supported by cookies.[6]
Data model
Web storage currently provides an associative array data model where the keys and values are both strings. An additional API for accessing structured data, perhaps based on SQL, is being considered by the W3C Web Applications Working Group.[7]
Nomenclature
The W3C draft is titled "Web Storage", but "DOM storage" is also a commonly used name.[8][9]
The "DOM" in DOM storage doesn't literally refer to the Document Object Model. "The term DOM is used to refer to the API set made available to scripts in Web applications, and does not necessarily imply the existence of an actual Document object..."[10]
Web Storage Management
Storage of Web Storage Objects is enabled per default in Mozilla Firefox and Seamonkey, but can be disabled by setting the "about:config" parameter "dom.storage.enabled" to false. [11]
Mozilla Firefox stores all Web Storage objects in a single file named webappsstore.sqlite. The sqlite3 command can be used to show the elements stored therein. [12]
There are browser extensions/add-ons for Google Chrome and Mozilla Firefox available that let the user deal with web Storage, such as "Click&Clean",[13][14] "BetterPrivacy" which can be configured to remove the whole Web Storage automatically on a regular basis.[15][16][17]
Similar technologies
- HTTP cookies
- Indexed Database API[18] (formerly WebSimpleDB)
- Web SQL Database
- Local Shared Objects in Adobe Flash
- userData Behavior in Internet Explorer
- Google Gears for IE, Firefox, Safari and Windows Mobile
References
- ^ Web Storage. W3.org. Retrieved on 2011-06-12.
- ^ Mozilla Developer Center: DOM Storage. Developer.mozilla.org. Retrieved on 2011-06-12.
- ^ Web Storage (DOM Storage). Dive Into JavaScript (2010-07-14). Retrieved on 2011-06-12.
- ^ John Resig: DOM Storage. Ejohn.org. Retrieved on 2011-06-12.
- ^ MSDN: Introduction to DOM Storage. Msdn.microsoft.com. Retrieved on 2011-06-12.
- ^ W3C: Web Storage draft standard. Dev.w3.org (2004-02-05). Retrieved on 2011-06-12.
- ^ W3C: Web SQL Database (working draft). W3.org (2010-11-18). Retrieved on 2011-06-12.
- ^ Mozilla Developer Center: DOM Storage. Developer.mozilla.org. Retrieved on 2011-06-12.
- ^ MSDN: Introduction to DOM Storage. Msdn.microsoft.com. Retrieved on 2011-06-12.
- ^ W3C: Web Storage draft standard. Dev.w3.org (2004-02-05). Retrieved on 2011-06-12.
- ^ Mozillazine article on disabling Web Storage Objects in about:config. Kb.mozillazine.org. Retrieved on 2011-06-12.
- ^ Firefox’s Super Cookies, Cerias, January 16, 2008
- ^ "Click&Clean" extension for Google Chrome. Hotcleaner.com (2011-06-01). Retrieved on 2011-06-12.
- ^ "Click&Clean add-on for Mozilla Firefox. Addons.mozilla.org. Retrieved on 2011-06-12.
- ^ Mozilla add-ons page for "Better Privacy". Addons.mozilla.org. Retrieved on 2011-06-12.
- ^ Homepage of "Better Privacy", with some further references to blogs and articles. Netticat.ath.cx. Retrieved on 2011-06-12.
- ^ Google Chrome Browser Client-Side Storage. Hotcleaner.com. Retrieved on 2011-06-12.
- ^ Indexed Database API. W3.org. Retrieved on 2011-06-12.
External links
Categories:- World Wide Web Consortium standards
- Internet privacy
Wikimedia Foundation. 2010.