Paul
0
Q:

local storage ha

function setItem(name, value) {
  localStorage.setItem(name, value);
}
function getItem(name) {
  localStorage.getItem(name);
}
function deletItem(name) {
  localStorage.removeItem(name);
}
function clearStorage() {
  localStorage.clear();
}
3
As the answers here already talk about the coding aspect. I will talk about
the concept.
Local storage is basically an object stored in the specific browser you are 
using in that moment. And thus it is tied to that browser in that device. It's 
duration is infinite so it never expires

If you only want to store data that only lasts for that browser session(
starts when you open a window and ends when you close it) then the best choice
is sessionStorage
1

function set(){
    var sendJson = JSON.stringify(allPerfume);
    localStorage.setItem("allPerfume", sendJson);
}

function get() {
    var getJson = localStorage.getItem("allPerfume")
    if (getJson) {
        allPerfume = JSON.parse(getJson);
    }
}
0

New to Communities?

Join the community