Local Storage

Recommend this page to a friend!

      JS Local Storage Library  >  All threads  >  Local Storage  >  (Un) Subscribe thread alerts  
Subject:Local Storage
Summary:Different from Cookies?
Messages:4
Author:Gerry Danen
Date:2013-09-25 15:34:55
Update:2013-10-06 13:48:28
 

  1. Local Storage   Reply   Report abuse  
Picture of Gerry Danen Gerry Danen - 2013-09-25 15:34:55
How does local storage differ from cookies?

  2. Re: Local Storage   Reply   Report abuse  
Picture of Developer CK Developer CK - 2013-09-26 15:29:19 - In reply to message 1 from Gerry Danen
This comes with browser who support HTML5 localstorage feature.

Cokkie can store a limited amount of data that in KB(~100kb).

and the second thing is

cokkie is passed to server with every request.so it make a request heavy if you store data in cokkie.

While localstorage of browser can store upto 5 mb of data in browser.
and you can manipulate it with javascript.

  3. Re: Local Storage   Reply   Report abuse  
Picture of Jason Gerfen Jason Gerfen - 2013-10-06 12:20:01 - In reply to message 2 from Developer CK
You should also mention that localStorage, formerly introduced with HTML5, in addition to having larger storage per origin (ie. http://jsclasses.org will have 5MB of storage, where http://website.com will also have 5MB of storage).

It is also persistent indefinately where cookies have an optional expiration UTC date that can be assigned and the browser will adhere to by removing the cookie if that time is greater than the current system time.

This is true for sessionStorage as well, the primary difference between localStorage & sessionStorage is that sessionStorage is the more secure option as it will remove any data when the browser is closed.

I also think the authors reply with *100kb per cookie* is inaccurate, it is only 4093 bytes per domain (4kb).

  4. Re: Local Storage   Reply   Report abuse  
Picture of Developer CK Developer CK - 2013-10-06 13:48:28 - In reply to message 3 from Jason Gerfen
Yes you are right,
Read this-
before 2002
Microsoft invented a great many things, one of these things was called DHTML Behaviors, and one of these behaviors was called userData.

userData allows web pages to store up to 64 KB of data per domain, in a hierarchical XML-based structure. (Trusted domains, such as intranet sites, can store 10 times that amount.

In 2002, Adobe introduced a feature in Flash 6 that gained the unfortunate and misleading name of “Flash cookies.” Within the Flash environment, the feature is properly known as Local Shared Objects. Briefly, it allows Flash objects to store up to 100 KB of data per domain.

In 2007, Google launched Gears, an open source browser plugin aimed at providing additional capabilities in browsers. Gears provided an API to an embedded SQL database based on SQLite.
HTML5 set out to solve: to provide a standardized API, implemented natively and consistently in multiple browsers, without having to rely on third-party plugins to provide local storage.