open-vault/ui/app/lib/local-storage.js
Chelsea Shaw a77899d276
UI: Switch usage of localStorage to sessionStorage (#14054)
* Switch usage of localStorage to sessionStorage in UI

* Add changelog
2022-02-17 10:04:53 -06:00

19 lines
359 B
JavaScript

export default {
getItem(key) {
var item = window.sessionStorage.getItem(key);
return item && JSON.parse(item);
},
setItem(key, val) {
window.sessionStorage.setItem(key, JSON.stringify(val));
},
removeItem(key) {
return window.sessionStorage.removeItem(key);
},
keys() {
return Object.keys(window.sessionStorage);
},
};