Objects used for storing data on client provided by HTML local storage

Q.  Which are the objects used for storing data on the client provided by the HTML local storage?
- Published on 27 Aug 15

a. window.localStorage
b. window.sessionStorage
c. window.localSession
d. both a & b

ANSWER: both a & b
 

    Discussion

  • Nirja Shah   -Posted on 06 Nov 15
    - There are two objects provided by the HTML local storage for storing data on the client:

    - window.localStorage - It stores data with no expiration date
    - window.sessionStorage - It stores data for one session (data is lost when the browser tab is closed)

    localStorage Object
    - This object stores the data with no expiration date.
    - Whenever the browser is closed data will not be deleted, and will be available the next day, week, or year.

    sessionStorage Object
    - This object is equal to the localStorage object, except that it stores the data for only one session.
    - Whenever the user closes the specific browser tab data will be deleted.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)