Class 13 Summary:
THE PAST, PRESENT & FUTURE OF LOCAL STORAGE FOR WEB APPLICATIONS :
- Cookies were invented early in the web’s history to be used for presistent local storage of small amount of data . But the negative aspects are:
- Cookies included with every HTTP request : slowly down the web application by transmitting the same data over needlessly.
- Cookies included with every HTTP request :sending data unencrypted over the internet.
- Cookies limited at about 4 KB data, this slow the application.
- We need :
- a lot of storage space.
- on the client.
- isn’t transmitted to server.
Breif History Of Local Storage:
-
Microsoft invented DHTML Brhaviors , one of them is (userData) which allws web pages to store up to 64 KB of data per domain.
-
In 2002 Adobe introduced Flash 6 (Flash cookies) to store up to 100 KB of data per domain.
-
In 2007 Google launched Gears which can store unlimited amounts of data per domain in SQL database tables.
HTML5 Storage:
-
It’s a way for web pages to store named key/value pairs locally, within the client web browser.
-
From Java Script code , we will access HTML5 storage through the local storage object on the global window object.
Using HTML5 Storage:
- With web storage, web applications can store data locally within the user’s browser.
- HTML5 Storage is based on named key/value pairs.
- We will need to use functions like: parseInt() , parseFloat() , Calling getItem() , setItem()
- example:
Tracking Changes To HTML5 Storage Area:
*example:
HTML Web Storage Objects:
- HTML provides two objects for storing data :
- Windows.localStorage (stores data with no expiration date)
- windows.sessionStorage (stores data for one session)
** this information from web
Sukina AbuHammad