1.

State difference between Local Storage and Cookies.

Answer»

The differences between local storage and cookies are as follows:

Local StorageCookies
Local storage generally stores large amounts of data on the client's COMPUTER (client’s browser) as key-value pairs.Simply put, a cookie is a small text file containing information about a website, like a USERNAME or a password. When you visit a particular website, this website SAVES some information in your local system so that it can recognize you and display results according to your preferences.
The client can only access local storage. It is impossible for a SERVER to use local storage unless it deliberately makes a request to the server via GET or POST.Servers and clients are both able to read and write cookies.
Local storage has a storage capacity of 5MB/10MB.Cookies have a storage capacity of 4KB.
Local storage does not have an expiration date, so it must be manually removed.Cookies have an expiration date and cookie data is purged after a CERTAIN period of time.


Discussion

No Comment Found