I've encountered an issue with localStorage. Here is a snippet of my code:
var defaultReportData = {
'station': 'DR P3',
'days': 'Mon, Tue, Wed, Thur, Fri',
'startHour': '06:00',
'endHour': '18:00',
'demography': 'Cover: All'
}
localStorage.setItem('defaultReportData', JSON.stringify(defaultReportData));
// Returns null
console.log(localStorage.getItem('station'));
After loading the page, if I simply type "localStorage" in my console, the object displays correctly. However, when I try to retrieve a specific value from localStorage, it returns null.
What could be causing this issue?