{"id":12842,"date":"2022-09-20T13:07:49","date_gmt":"2022-09-20T11:07:49","guid":{"rendered":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/?p=12842"},"modified":"2022-09-29T15:30:22","modified_gmt":"2022-09-29T13:30:22","slug":"javascript-local-storage-2","status":"publish","type":"post","link":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/","title":{"rendered":"Javascript Local Storage: The browser as a datastore"},"content":{"rendered":"\n<p class=\"has-medium-font-size wp-block-paragraph\">&nbsp;<a href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/grapesjs-web-builder\/\">Javascript<\/a>\u00a0 is undoubtedly the most used and widespread language in the world. Useful for running code inside a web browser window. Over time it has also become a very reliable and mature language. Like all languages, it is characterized by the presence of APIs that enrich the language with extraordinary functionality. For some years now the <a href=\"https:\/\/dev.to\/j471n\/how-to-use-web-storage-api-3o28\" target=\"_blank\" rel=\"noreferrer noopener\">Web Storage API<\/a>, that is the library that deals with the management of the storage of objects, used in the execution phase of Javascript code, has been updated with the implementation of two new properties managed by the window object. The two properties in question are: localStorage and sessionStorage. Both create \u201c<strong>Javascript Local Storage<\/strong>\u201d. An environment that will transform your web browser into a real local datastore of objects.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_87 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">In questo articolo:<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#1_Difference_between_Cookie_localStorage_and_sessionStorage\" >1. Difference between Cookie, localStorage and sessionStorage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#2_Javascript_Local_Storage_in_Action\" >2. Javascript Local Storage in Action<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#3_Delete_localStorage_objects\" >3. Delete localStorage objects<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#4_Conclusion\" >4. Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Difference_between_Cookie_localStorage_and_sessionStorage\"><\/span><strong>1. Difference between Cookie, localStorage and sessionStorage<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Surely you are wondering: &#8220;What difference is there in managing a datastore using cookies from a management carried out using localStorage and sessionStorage?&#8221; The question is more than pertinent and, to be honest, I&#8217;m glad you asked it. As you well know, programming languages \u200b\u200bevolve and this evolution is often imposed by factors that impose an ever higher level of security management. Especially in the web environment. In fact, they work on the same origin policy. Therefore, the data stored on the client side will only be available on this source. Unlike cookies, localStorage and sessionStorage have wider memory limits for storing data. You will remember that with cookies you had a maximum of 4KB at your disposal. Well, localStorage and sessionStorage have a good 5MB available for the whole datastore. Furthermore, since the data can only be managed on the client side, it will not be sent from time to time to the server, reducing the traffic between client and server.<\/p>\n\n\n\n<hr>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Read more: <a href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/12-javascript-tricks-that-youll-never-find-in-most-tutorials\/\" target=\"_blank\" rel=\"noreferrer noopener\">12 JavaScript tricks that you&#8217;ll never find in most tutorials<\/a><\/p>\n\n\n\n<hr>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Javascript_Local_Storage_in_Action\"><\/span><strong>2. Javascript Local Storage in Action<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Now, after having dispelled all kinds of doubts about the use of Javascript Local Storage, let&#8217;s go back to the localStorage and sessionStorage properties. Like everything that has to do with development in general, a good example is the most important resource to explain in detail the implementation and use of these two fundamental properties. First, however, I anticipate that to set and retrieve data from the browser datastore, both localStorage and sessionStorage, they use two methods that leave no doubt about their function. The two methods are: setItem and getItem. In the following two examples, whose code you can test, by copying and pasting, in your html page, the two methods are implemented with disarming simplicity.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">localstorage example:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">&lt;! DOCTYPE html>\n&lt;html>\n   &lt;body>\n      &lt;h1> How localStorage works &lt;\/h1>\n      &lt;h2> The localStorage property &lt;\/h2>\n      &lt;p> The name stored in localStorage is: &lt;\/p>\n      &lt;p id = \"demo\"> &lt;\/p>\n      &lt;script>\n        \/\/ -------------------------------\n        \/\/ Set the \"lastname\" variable\n        \/\/ -------------------------------\n        localStorage.setItem (\"lastname\", \"Smith\");\n\n        \/\/ -----------------------------------------------\n        \/\/ Get the content of the \"lastname\" variable\n        \/\/ and displays it in the \"demo\" paragraph\n        \/\/ -----------------------------------------------\n        document.getElementById (\"demo\"). innerHTML = localStorage.getItem (\"lastname\");\n      &lt;\/script>\n   &lt;\/body>\n&lt;\/html>\n<\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">sessionStorage example:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">&lt;html>\n   &lt;body>\n      &lt;h1> How sessionStorage works &lt;\/h1>\n      &lt;h2> The sessionStorage property &lt;\/h2>\n      &lt;p> The Name is: &lt;\/p>\n      &lt;p id = \"demo\"> &lt;\/p>\n      &lt;script>\n         \/\/ -------------------------------------------\n         \/\/ Set the \"lastname\" session variable\n         \/\/ -------------------------------------------\n         sessionStorage.setItem (\"lastname\", \"Smith\");\n\n         \/\/ ------------------------------------------------ -----------\n         \/\/ Get the contents of the session variable \"lastname\"\n         \/\/ and displays it in the \"demo\" paragraph\n         \/\/ ------------------------------------------------ -----------\n         let personName = sessionStorage.getItem (\"lastname\");\n         document.getElementById (\"demo\"). innerHTML = personName;\n      &lt;\/script>\n   &lt;\/body>\n&lt;\/html>\n<\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The code leaves no doubt. Understanding the operation of these two extraordinary properties of the window object is extremely simple. However, it is worth pointing out when to use localStorage and when to use sessionStorage. The substantial difference between localStorage and sessionStorage concerns only the visibility that the objects treated have within the datastore of a browser. In fact, while with sessionStorage the objects are visible only for the window \/ tab in which they were set and remain active until the window \/ tab of the browser that generated them is closed. With localStorage the data persist until they are explicitly deleted and, if not removed, they will also be available for future visits to the web page but only on the same origin. The data stored with localStorage has no expiry date.<\/p>\n\n\n\n<hr>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Read more: <a href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/web-app-development-with-wordpress-php-and-codeless-framework\/\" target=\"_blank\" rel=\"noreferrer noopener\">Web app development with WordPress, PHP and CodeLess Framework<\/a><\/p>\n\n\n\n<hr>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Delete_localStorage_objects\"><\/span><strong>3. Delete localStorage objects<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">As previously mentioned, Javascript has been enriched with two properties. The first, localStorage, very convenient and widely used by developers, capable of storing data within the browser, but, after closing the browser window \/ tab that generated the data, the information will continue to persist until the developer it will not explicitly delete them. The second property, sessionStorage, defines session objects. As for sessionStorage, managing session objects, they will be automatically removed when the browser or window \/ tab that generated them is closed. While, the elimination of objects, generated with the localStorage property, occurs explicitly. This means that the programmer will manage its life.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Deleting objects created by localStorage is very simple. In fact, this property has a &#8220;removeItem&#8221; method that receives the object to be deleted as a parameter. So, if you want to delete the &#8220;lastname&#8221; object, present in the two scripts discussed in the previous paragraph, you need to run this command:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">localStorage.removeItem ('lastname');<\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">After running this command, the &#8220;lastname&#8221; object will be completely removed from the browser&#8217;s datastore. Until this operation is carried out, all objects, created with the localStorage property, will always be available, even after days, on the same origin. That is, the same computer and the same browser will access localStorage objects until they are explicitly deleted.<\/p>\n\n\n<div class='code-block code-block-1' style='margin: 8px auto; text-align: center; display: block; clear: both;'>\n<center>\n<div class=\"aicp\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-0994451288478537\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-0994451288478537\"\n     data-ad-slot=\"6201132911\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/div>\n<\/center>\n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Conclusion\"><\/span><strong>4. Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">To dispel any doubts about the use of these two extraordinary new properties of the window object, I recommend that you follow this short video tutorial that will allow you to understand in detail the differences between these two fundamental properties.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"JavaScript LocalStorage and Session Storage API Tutorial\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/zmFDvFwj6-8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><figcaption><a href=\"https:\/\/youtu.be\/zmFDvFwj6-8\" target=\"_blank\" rel=\"noreferrer noopener\">localStorage and sessionStorage in Javascript<\/a><\/figcaption><\/figure>\n\n\n<div class='code-block code-block-1' style='margin: 8px auto; text-align: center; display: block; clear: both;'>\n<center>\n<div class=\"aicp\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-0994451288478537\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-0994451288478537\"\n     data-ad-slot=\"6201132911\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<\/div>\n<\/center>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>With Javascript Local Storage, you can turn your browser into a datastore. That is, you can set and retrieve objects within the web browser and store data with no expiration date.<\/p>\n","protected":false},"author":1,"featured_media":12845,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[268,1059],"tags":[2810,2835,2812,2837,2839,2841,2843,2845],"class_list":["post-12842","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles-en","category-development","tag-development-en","tag-html-en","tag-javascript-en","tag-new-en","tag-to-en","tag-tutorial-en","tag-video-en","tag-web-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Javascript Local Storage: The browser as a datastore<\/title>\n<meta name=\"description\" content=\"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Javascript Local Storage: The browser as a datastore.\" \/>\n<meta property=\"og:description\" content=\"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Antonio Lamorgese\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-20T11:07:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-29T13:30:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Antonio Lamorgese\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Javascript Local Storage: The browser as a datastore\" \/>\n<meta name=\"twitter:description\" content=\"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@AntonioLamorge3\" \/>\n<meta name=\"twitter:site\" content=\"@AntonioLamorge3\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"Antonio Lamorgese\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/\"},\"author\":{\"name\":\"Antonio Lamorgese\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\"},\"headline\":\"Javascript Local Storage: The browser as a datastore\",\"datePublished\":\"2022-09-20T11:07:49+00:00\",\"dateModified\":\"2022-09-29T13:30:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/\"},\"wordCount\":855,\"publisher\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\"},\"image\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg\",\"keywords\":[\"development\",\"html\",\"javascript\",\"new\",\"to\",\"tutorial\",\"video\",\"web\"],\"articleSection\":[\"Blog Articles\",\"Development\"],\"inLanguage\":\"it-IT\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/\",\"name\":\"Javascript Local Storage: The browser as a datastore\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg\",\"datePublished\":\"2022-09-20T11:07:49+00:00\",\"dateModified\":\"2022-09-29T13:30:22+00:00\",\"description\":\"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg\",\"contentUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg\",\"width\":800,\"height\":450,\"caption\":\"javascript local storage\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/javascript-local-storage-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Development\",\"item\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/category\\\/development\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Javascript Local Storage: The browser as a datastore\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#website\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/\",\"name\":\"Antonio Lamorgese\",\"description\":\"Il web e i suoi strumenti operativi\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\",\"name\":\"Antonio Lamorgese\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\",\"contentUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\",\"width\":120,\"height\":130,\"caption\":\"Antonio Lamorgese\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\"},\"description\":\"Amministratore di rete e sviluppatore. Dopo anni di esperienza nel settore, ho ideato un sistema di gestione dati MYSQL in PHP senza scrivere una sola riga di codice.&nbsp;Scopri di pi\u00f9....\",\"sameAs\":[\"https:\\\/\\\/www.Phpcodewizard.it\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/antonio-lamorgese-660735190\\\/\",\"https:\\\/\\\/pinterest.it\\\/antoniolamorgese9711\\\/\",\"https:\\\/\\\/x.com\\\/AntonioLamorge3\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/antoniolamorgese\",\"https:\\\/\\\/tumblr.com\\\/blog\\\/phpcodewizard\"],\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/author\\\/antonio-lamorgese\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Javascript Local Storage: The browser as a datastore","description":"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/","og_locale":"it_IT","og_type":"article","og_title":"Javascript Local Storage: The browser as a datastore.","og_description":"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.","og_url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/","og_site_name":"Antonio Lamorgese","article_published_time":"2022-09-20T11:07:49+00:00","article_modified_time":"2022-09-29T13:30:22+00:00","og_image":[{"width":800,"height":450,"url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg","type":"image\/jpeg"}],"author":"Antonio Lamorgese","twitter_card":"summary_large_image","twitter_title":"Javascript Local Storage: The browser as a datastore","twitter_description":"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.","twitter_image":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg","twitter_creator":"@AntonioLamorge3","twitter_site":"@AntonioLamorge3","twitter_misc":{"Scritto da":"Antonio Lamorgese","Tempo di lettura stimato":"6 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#article","isPartOf":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/"},"author":{"name":"Antonio Lamorgese","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0"},"headline":"Javascript Local Storage: The browser as a datastore","datePublished":"2022-09-20T11:07:49+00:00","dateModified":"2022-09-29T13:30:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/"},"wordCount":855,"publisher":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0"},"image":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg","keywords":["development","html","javascript","new","to","tutorial","video","web"],"articleSection":["Blog Articles","Development"],"inLanguage":"it-IT"},{"@type":"WebPage","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/","name":"Javascript Local Storage: The browser as a datastore","isPartOf":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#primaryimage"},"image":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg","datePublished":"2022-09-20T11:07:49+00:00","dateModified":"2022-09-29T13:30:22+00:00","description":"With Javascript local storage, you will transform your browser into a real datastore of local and session objects.","breadcrumb":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#primaryimage","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg","contentUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2022\/09\/Javascript-Local-Storage-The-browser-as-a-datastore.jpg","width":800,"height":450,"caption":"javascript local storage"},{"@type":"BreadcrumbList","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/javascript-local-storage-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/"},{"@type":"ListItem","position":2,"name":"Development","item":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/category\/development\/"},{"@type":"ListItem","position":3,"name":"Javascript Local Storage: The browser as a datastore"}]},{"@type":"WebSite","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#website","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/","name":"Antonio Lamorgese","description":"Il web e i suoi strumenti operativi","publisher":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":["Person","Organization"],"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0","name":"Antonio Lamorgese","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png","contentUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png","width":120,"height":130,"caption":"Antonio Lamorgese"},"logo":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png"},"description":"Amministratore di rete e sviluppatore. Dopo anni di esperienza nel settore, ho ideato un sistema di gestione dati MYSQL in PHP senza scrivere una sola riga di codice.&nbsp;Scopri di pi\u00f9....","sameAs":["https:\/\/www.Phpcodewizard.it\/","https:\/\/www.linkedin.com\/in\/antonio-lamorgese-660735190\/","https:\/\/pinterest.it\/antoniolamorgese9711\/","https:\/\/x.com\/AntonioLamorge3","https:\/\/www.youtube.com\/user\/antoniolamorgese","https:\/\/tumblr.com\/blog\/phpcodewizard"],"url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/author\/antonio-lamorgese\/"}]}},"_links":{"self":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/posts\/12842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/comments?post=12842"}],"version-history":[{"count":0,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/posts\/12842\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/media\/12845"}],"wp:attachment":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/media?parent=12842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/categories?post=12842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/tags?post=12842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}