When will sessionStorage and localStorage be used respectively?

when will sessionStorage and localStorage be used respectively? Do you see that localStorage, is used more often? do they have their own usage scenarios? Or do you like it all by yourself?

Dec.14,2021

when to use is based on their respective functions and requirements.
localStorage can be stored for a long time, as long as you do not clean up the data will exist for a long time, for example, the background menu loaded with ajax can be stored at login
sessionStorage life cycle is the current window or tab, once the window or tab is permanently closed, then all data stored through sessionStorage will be emptied.
and different pages in the same browser can share the same localStorage, but different pages or tabbed pages cannot share sessionStorage information (if a tab contains multiple iframe tags and they belong to the same origin page, then they can share sessionStorage)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e486-41441.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e486-41441.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?