These two forms of in browser storage allow the website owner to track various information about the user’s session and behaviours and enhance their experience across a single or multiple sessions.
Cookies have a significantly smaller storage capacity than localStorage; 4KB as opposed to 5MB. Also, under EU regulations you must inform a user if you intend to use them via an acceptance message in the UI, which can have an effect on your UX.
Cookies are not recommended for long-term storage of information in a browser for these reasons.
localStorage is a new concept, arriving with HTML5, relatively recently. While it can be disabled via a browsers settings, most come with the feature activated by default. localStorage does not prompt the user when it is used, which is better for the overall experience and as mentioned above, allows much greater storage regarding a user’s interaction with your website.
localStorage is recommended for storing things in the browser that will persist beyond the current session. To remove things in localStorage you have to explicitly clear them (similar to cookies).
Donky uses localStorage to store information like a user’s registration to the Donky network and other data to improve consistency across multiple sessions.
sessionStorage is recommended for storing things that you do not want to persist beyond the current session. This is because sessionStorage is wiped completely clean when the visitor leaves the domain or closes the browser. This makes it an excellent repository for session-based information such as temporary shopping carts, lists of items to compare, etc.
Donky does not use sessionStorage currently (Dec 2014)
The effect of these on your users and network
There is one important piece of information to have here:
If a user clears there cookies it will have no effect on Donky. However, if they clear cookies and “other site plugin data” as specified in browsers such as Google Chrome and Internet Explorer, their registration to the Donky network will be lost.
For anonymous users, this means that a new user will be created the next time they visit the site. Known users will need to register again, or provide their user ID again to be connected. For example on completion of an eCommerce process.