- 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.
12 Respostas
+ 9
They are the same but session storage gets cleared at end of sessionâŠ
+ 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? :)
+ 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 )
+ 1
ok i got it
+ 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..
+ 1
one
0
thank you both of you. Michale, can yoy tell me local storge is used what type of conent?
0
nice
0
one
0
one
- 1
one
- 1
one