For what local storage is used in web? for what session storage is used? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

For what local storage is used in web? for what session storage is used?

Name the thing which is stored by local storage and name the thing which is stored by session storage.

9th Jan 2017, 8:22 PM
Naimish Vasoya
Naimish Vasoya - avatar
12 Answers
+ 9
They are the same but session storage gets cleared at end of session…
9th Jan 2017, 9:05 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 6
Sessions are used to make users work with site more comfortable. Session stores your id, so sie knows who are you and can show information, that you are interested in. For example if you login on some site it stores that user with this id is logged in and shows you needle information. 2nd examle is 'shoping carts'. Sessions just save some information to use it on other pages Local storage is used by JS, not the server, so it might be used to store some data, withot passing it to server UPD: local storage can hold any type of content, that can be used in js, but maximal size of local storage is defined by browser, so you can't store more that it(browser) accepts. For more precise values use... internet? :)
9th Jan 2017, 9:07 PM
WittyBit
WittyBit - avatar
+ 3
Local and session storage handles paired text key/value... but you can store any type of content you want by encoding them in a text format ( as JSON ). Important things about storage: - new in html5 - unique access per domain ( as for cookies ) - size limit greater than cookies, but can be navigator/user dependant ( about 5-10MB per origin instead 2KB for cookies ) - contrary to cookies, data cannot be shared/access with/by server through http headers ( but obviously, still possible to use Ajax to communicate ) - data stored in navigator, means one set of value by navigator access ( each navigator on each device )
11th Jan 2017, 12:09 AM
visph
visph - avatar
+ 1
ok i got it
9th Jan 2017, 9:23 PM
Naimish Vasoya
Naimish Vasoya - avatar
+ 1
Use local storage to have persistent data between sessions like web preferences, session logs, forms personal data (name, email, telephone, ...) Do not save sensitive data like passwords, SSN or account nos, etc..
9th Jan 2017, 10:36 PM
Jose Luis
Jose Luis - avatar
+ 1
one
14th Apr 2023, 5:59 PM
Adama Diouf
Adama Diouf - avatar
0
thank you both of you. Michale, can yoy tell me local storge is used what type of conent?
9th Jan 2017, 9:10 PM
Naimish Vasoya
Naimish Vasoya - avatar
0
nice
25th Nov 2020, 8:56 AM
SULTAN ALMOHAWIST-AR2
SULTAN ALMOHAWIST-AR2 - avatar
0
one
24th Oct 2022, 3:00 PM
farid khairy
0
one
12th Feb 2023, 9:27 AM
Amu Azad
- 1
one
19th Mar 2021, 12:46 PM
Rahmatullayev Behruzjon Ravshan o`g`li
- 1
one
22nd Sep 2021, 9:49 PM
Pallav jha
Pallav jha - avatar