forked from wet-boew/wet-boew
-
Notifications
You must be signed in to change notification settings - Fork 0
Session Storage
pjackson28 edited this page Sep 2, 2013
·
4 revisions
Project lead: Paul Jackson (@pjackson28)
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.
- In cases where browser don't support sessionStorage, the polyfill is automatically loaded.
Storing data for the current session.
value = sessionStorage.getItem('variable'); sessionStorage.setItem('variable', value);
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:
- js/polyfills/sessionstorage.js - contains the JavaScript code for the sessionStorage polyfill
This polyfill is dependent upon cookies so will not work where cookies can't be used (e.g., viewing the page offline).