I am trying to use localStorage to get the value from a form and fill some fields of a second form on a second page. The storing fields part works well but on the second page, there is an iframe and apparently it uses localStorage. When I try to use localStorage on the second page it retrieves the values from this "second" localStorage instead.
// This displays the correct localStorage info, so on page load, it seems to only be 1 localStorage
console.log(localStorage);
// Retrieve session storage fields
// This comes back as null, second localStorage is loaded?
var firstName = localStorage.getItem('firstName');
var lastName = localStorage.getItem('lastname');
var eMail = localStorage.getItem('eMail');
var phone = localStorage.getItem('phone');
var company = localStorage.getItem('company');
var companyRole = localStorage.getItem('companyRole');
// This does not work as a result
j('#first-name').val(firstName);
j('#last-name').val(lastName);
j('#phone').val(phone);
j('#eMail').val(eMail);
When I check the localStorage Object under the "application" Chrom tab, I see 2 Objects and inspecting the first one, I do see my data...I haven't found anything about how to access a different localStorage Object, is that even possible?