Thanks @Drev92 ! I’ve done exactly that!
Thanks @bentom03 ! For your help.
Oh! Thanks for your advice @snigo.
Correction - Use sessionStorage instead of localStorage. Otherwise the value will remain in the storage even after the session expires. My bad, sorry!