Magento Expert Forum - Improve your Magento experience

Results 1 to 11 of 11

What is difference between session storage and local storage?

  1. #1

  2. #2
    Junior Member
    Join Date
    Sep 2016
    Posts
    308
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    SessionStorage and LocalStorage is client storage solutions. localStorage and sessionStorage both can be cleared by user and can easily read by user . You should not rely on these and should not store sensitive data into localStorage and sessionStorage its easily readable by user. Its good when data needed within client scripts between pages (for example: preferences, menus, last login, last page view).

  3. #3

  4. #4
    Junior Member aditiaggarwal's Avatar
    Join Date
    Nov 2016
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sessionStorage, localStorage and Cookies all are used to store data on the client side. Each one has its own storage and expiration limit. sessionStorage: similar to localStorage but expires when the browser closed (not the tab). Cookie: stores data that has to be sent back to the server with subsequent requests.Annax Technologies

  5. #5
    Junior Member
    Join Date
    Sep 2016
    Posts
    109
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended "non-persistence" of sessionStorage.
    That is, the data stored in localStorage persists until explicitly deleted. Changes made are saved and available for all current and future visits to the site.
    For sessionStorage, changes are only available per window (or tab in browsers like Chrome and Firefox). Changes made are saved and available for the current page, as well as future visits to the site on the same window. Once the window is closed, the storage is deleted.

    Pen Drive With Logo | Promotional Pen Drive

  6. #6
    New member
    Join Date
    May 2016
    Location
    Bangalore, India
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    local storage stores the data without expiry date and session storage has expiry date and expires when browser closed

  7. #7
    Junior Member knowband.plugins's Avatar
    Join Date
    Jul 2016
    Location
    Noida, India
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Session storage and local storage are storage mechanism which uses client system for storing data. These are temporary means of storing data and can be cleared by user

    Session storage is last as long as browser is open i.e it is removed when browser is closed. If data is to be stored even after closing of browser then local storage is preferred. In local storage data is not deleted until it is deleted by user. If some changes are made in local storage then it will be reflected in current and future visits but the changes of session storage lasts only till the browser is open.

    Regards,

    Knowband Plugins

  8. #8
    Junior Member
    Join Date
    Aug 2016
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    SessionStorage - The sessionStorage object is use to store data into client browser. sessionStorage is only available for the duration of the browser session and is deleted when the window is closed. sessionStorage depend upon session of a page. Page session maintain till user not open new tab or window or not reloads page.

    LocalStorage -localStorage object is also store information into clients browser. The main difference is that localStorage has no expiration time. localStorage data persist till user not clear data or reset browser. Means user clear data from browser. To know more about this, visit- http://www.codeandyou.com/2015/07/di...orage-and.html

  9. #9
    Junior Member
    Join Date
    Aug 2016
    Posts
    110
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    sessionStorage, localStorage and Cookies all are used to store data on the client side
    similar to localStorage but expires when the browser closed

  10. #10
    Junior Member
    Join Date
    Oct 2016
    Posts
    317
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Session storage and local storage are basically two types of web storage. The main difference is that the local storage persists over different tabs or windows, and even if we close the browser, accordingly with the domain security policy and user choices about quota limit.

    Session storage will generally allow you to store any primitives or objects supported by your Server side language/framework. Session storage is only available for the duration of the browser session (and is deleted when the tab or window is closed) - it does however survive page reloads.

  11. #11
    Junior Member
    Join Date
    Mar 2017
    Posts
    30
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    sessionStorage, localStorage and Cookies all are used to store data on the client side

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •