HTML5 and Local Storage.

Slides:



Advertisements
Similar presentations
Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Advertisements

4.01 How Web Pages Work.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Servlets and a little bit of Web Services Russell Beale.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
 A cookie is a piece of text that a Web server can store on a user's hard disk.  Cookie data is simply name-value pairs stored on your hard disk by.
Chapter 25 Utilizing Web Storage.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 48 How Internet Sites Can Invade Your Privacy.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Cookies & Sessions.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
IT533 Lectures Session Management in ASP.NET. Session Tracking 2 Personalization Personalization makes it possible for e-businesses to communicate effectively.
State Management. What is State management Why State management ViewState QueryString Cookies.
Chapter 8 Cookies And Security JavaScript, Third Edition.
CHAP 6. USING THE HTML5 WEB STORAGE API.  Cookie - Are a built-in way of sending text values back and forth from server to client.  Servers can use.
PHP1-1 PHP Lecture 2 Xingquan (Hill) Zhu
Regular Expression (continue) and Cookies. Quick Review What letter values would be included for the following variable, which will be used for validation.
Chapter 6 Server-side Programming: Java Servlets
Cookies Web Browser and Server use HTTP protocol to communicate and HTTP is a stateless protocol. But for a commercial website it is required to maintain.
1 Chapter 9 – Cookies, Sessions, FTP, and More spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
Internet & World Wide Web How to Program, 5/e. 2.
CP476 Internet Computing CGI1 Cookie –Cookie is a mechanism for a web server recall info of accessing of a client browser –A cookie is an object sent by.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
HTML 5 Tutorial Chapter 6 Web Storage. Storing Data on The Client HTML5 offers two new objects for storing data on the client: localStorage - stores data.
CS2550 Dr. Brian Durney. SOURCES  JavaScript: The Definitive Guide, by David Flanagan  Dive into HTML5, by Mark Pilgrim
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
PHP and Sessions. Session – a general definition The GENERAL definition of a session in the “COMPUTER WORLD” is: The interactions (requests and responses)
Rich Internet Applications 9. HTML 5 and RIAs. HTML 5 Standard currently under development by W3C Aims to improve the language with support for the latest.
- How to draw a clear distinction between a client and a server(there is often no clear distinction) - A server may continuously act as a client - Distinction.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
Presented By Nanda Kumar(972789) P. Trinesh (982816) Sk. Salma (982824) K. Madhuri (982814) HTML5.
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Phonegap Bridge – Storage CIS 136 Building Mobile Apps 1.
Web Storage and Cookies Cookies, Local and Session Storage SoftUni Team Technical Trainers Software University
Development of Internet Applications HTML5 Ing. Jan Janoušek 7.
4.01 How Web Pages Work.
Chapter 17 The Need for HTML 5.
Storing Data.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
Managing State Chapter 13.
Creating Databases Local storage. join & split
Warm Handshake with Websites, Servers and Web Servers:
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
ITM 352 Cookies.
Cookies and Sessions in PHP
CIS 136 Building Mobile Apps
The Request & Response object
Unit 27 Web Server Scripting Extended Diploma in ICT
Chapter 27 WWW and HTTP.
CIS 136 Building Mobile Apps
Building ASP.NET Applications
Web Programming Language
CSc 337 Lecture 27: Cookies.
HTML5 and Local Storage.
WJEC GCSE Computer Science
4.01 How Web Pages Work.
PHP-II.
4.01 How Web Pages Work.
CSc 337 Lecture 25: Cookies.
Presentation transcript:

HTML5 and Local Storage

Topics HTML5 Storage Key-value pairs localStorage Object

Cookies Storage typically used prior to HTML5 Before HTML5, websites could store only small amounts of text-based information on a user’s computer using cookies. A website might use a cookie to record user preferences or other information that it can retrieve during the client’s subsequent visits. When a user visits a website, the browser locates any cookies written by that website and sends them to the server. Cookies may be accessed only by the web server and scripts of the website from which the cookies originated The browser sends these cookies with every request to the server. Cookies have a number of problems associated with them. Offline access is not often performed very well. memory is limited.

HTML5 Storage   With HTML5, Local Storage is also known as HTML5 Storage, Web Storage or DOM Storage. HTML5 Storage offers a way for web applications and pages to store persistent data locally in web browsers. Persistent data stored does not expire with a session. If you browse away from the site that saved the data or close the browser, you will notice that the data is still there when you open it again or check for it locally. The storage option is supported by all modern browsers, even mobile ones.

HTML5 Client-Side Storage Overview Local Storage Session Storage IndexedDB Web SQL

Client-Side Local Storage localStorage is a single persistent object that represents Local Storage. Values can be set and retrieved even when the browser has been closed and re-opened.

Client-Side Session Storage sessionStorage is a single persistent object that represents Session Storage. Values are automatically cleared when the browser has been closed.

Client-Side Web SQL Web SQL is a structured database with all the functionality of a typical SQL-powered relational database. The database schema must be defined upfront, with all records in a table matching the same structure.

Client-Side IndexedDB IndexedDB is a key-value pair database that used index fields to search for values. There are no constraints on the database structure and no need to define anything upfront.

Examining Website Storage It is actually pretty easy to find out if a website uses Storage. If you are using Google Chrome, access Developer Tools. Examine Storage in Applications.

HTML5 Local Storage With HTML5, the mechanism for storage is key/value pairs. Web applications can use the window object’s localStorage property to store up to several megabytes of key/value-pair string data on the user’s computer and can access that data across browsing sessions. Unlike cookies, data in the localStorage object is not sent to the web server with each request. Websites often use both cookies and localStorage. Each website domain has a separate localStorage object – all the pages from a given domain share one localStorage object. Typically 5BM are reserved for each localStorage object. If the space is full, the browser can ask the user if more space should be allocated.

Key Value Pairs A key value pair is a key with a corresponding value. The key and value are both strings. For example Key: “address” Value: “1200 E Colton Ave”

localStorage Object localStorage is an object that allows access to a Storage object within the Document. The localStorage data is saved across browser sessions. localStorage data has no expiration time.

localStorage Object Methods length() to get the number of key-value pairs stored in local storage. key(i) to collect the key at index i. getItem() and setItem() to set and get a key item. removeItem() to remove a key-value pair from local storage