Hi Sahoo,
Below is some difference I could recall between localStorage and Cookies at the time of writing
Local storage
- Local storage stores the data in the form of key and value
- The data is stored for longer duration and remains in the browser unless user delete it explicitly, it remains even after computer restart
- No way to specify the time out period as the Cookies have
- Good to store large amount of data, up to 4MB
- Good to create offline application that runs in the client machine (browser)
- Easy to work with the JavaScript
- Local storage data is not sent to the server on every request (HTTP header) as it is purely at the client side
Cookies
- Good for small amount of data
- Difficult to work with JavaScript
- All data is transferred to and from server, so bandwidth is consumed on every request
- Can specify timeout period so that cookies data are removed from browser
Hope this helps.
Thanks
Regards,
Sheo Narayan
http://www.dotnetfunda.com
Sahoo, if this helps please login to Mark As Answer. | Alert Moderator