localStorage not working for Google Apps Script Web Apps

742 views
Skip to first unread message

account administrator

unread,
Sep 10, 2022, 2:55:27 PM9/10/22
to Google Apps Script Community
Anyone ever encountered and resolved this issue?

Web App 1 - works just fine.
<script>
    localStorage.nextAppointment = "01/01/2025";
    console.log(localStorage.getItem('nextAppointment') );
<script>

Web App 2 - which is execute only after Web App 1, returns null.
<script>
    console.log(localStorage.getItem('nextAppointment') );
<script>

The result is same even after modifying the Storage object to: 
window.localStorage.getItem('nextAppointment');

Note also, cookies have been cleared. Browser and PC restarted. Browser = Chrome.

Recommendations/ fixes would be greatly appreciated.

Faustino Rodriguez

unread,
Sep 11, 2022, 10:44:04 AM9/11/22
to Google Apps Script Community
As far as I understand localStorage (LS) is based in the document origin (web page or app in this case), so I guess you cannot access LS entries yo saved in App 1 from App 2
I am not sure though if there is another way

You can see the LS entries from the console Application > Local Storage


Reply all
Reply to author
Forward
0 new messages