Local Storage and Session Storage in HTML5

By | March 23, 2016

Local Storage:

  • in local storage data is storing in the browser

    its secure and more data can store

  • Local storage data storing in two object



    Local storage data will not be deleted after closing the browser. it will be avaialble in the user
    browser for ever.

    Example for Storing local storage.

    localStorage.myval=’vasanthan’ ;– this is for adding value
    localStorage.removeItem(“myval”);–remove the value

    Session Storage

    This is also equal to localstorage.but it stores the data for session basis,if we close the browser or
    browser tab it will delete storage value.