Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript persistent storage

//localStorage(Stores until data is cleared)
localStorage.name = 'value';
console.log(localStorage.name); // value
delete localStorage.name;
console.log(localStorage.name); // undefined

//sessionStorage(Stores until window is closed)
sessionStorage.name = 'value';
console.log(sessionStorage.name); // value
delete sessionStorage.name;
console.log(sessionStorage.name); // undefined
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #persistent #storage
ADD COMMENT
Topic
Name
8+8 =