localStorage and sessionStorage are the so-called WebStorages and HTML5 functions.
localStorage stores information until the user deletes them.
sessionStorage stores information as long as the session is in progress. Usually, until the user closes the tab / browser.
cookies are simply cookies that are supported by older browsers and are usually fallback for frameworks that use the aforementioned WebStorages .
In contrast, cookies can store less information than WebStorages, and information in WebStorages is never transferred to the server.
Keep in mind that there is a rule in the EU that requires websites to inform their users about the use of cookies. I don't know if this also applies to WebStorages
Rouby Apr 30 '15 at 5:58 2015-04-30 05:58
source share