Reputation: 764
I was wondering if it is possible to output with console using javascript some values which are stored inside chrome's Local Storage?
Upvotes: 2
Views: 5093
Reputation: 91
Try something like this:
localStorage.getItem('{attribute name that you want to get}')
In your case you can get the value by using this
localStorage.getItem('se:fkey')
you can also just type localStorage
in your chrome console to take a look at the available localstorage
Upvotes: 1
Reputation: 17952
Sure, just log your item:
console.log(localStorage.getItem('myItemName'));
Round-trip example:
const myThing = {
name: 'Dave',
age: 21
};
localStorage.setItem('myThing', JSON.stringify(myThing));
const myThingReturned = JSON.parse(localStorage.getItem('myThing'));
console.log('Before:', myThing);
console.log('After:', myThingReturned);
Upvotes: 4