Session storage (sessionStorage polyfill, Web Storage (HTML5)) - nschonni/wet-boew GitHub Wiki

français

Table of Contents

Overview

Project lead: Paul Jackson (@pjackson28)

Description

The HTML5 Web Storage sessionStorage object is used to store data for the current session. Because some browsers do not support this functionality natively, this polyfill emulates the same functionality.

Benefits

  • In cases where browser don't support sessionStorage, the polyfill is automatically loaded.

Recommended usage

Storing data for the current session.

Example Code

value = sessionStorage.getItem('variable');
sessionStorage.setItem('variable', value);

Examples

Development

Session storage functionality is dependent upon native support for the HTML5 Web Storage sessionStorage object or the sessionStorage polyfill.

The code for the sessionStorage polyfill is located within the source folder of WET:

Known Issues

This polyfill is dependent upon cookies so will not work where cookies can't be used (e.g., viewing the page offline).

Version History

References

⚠️ **GitHub.com Fallback** ⚠️