Allow access to sessionStorage and localStorage

Please provide an API to access JS sessionStorage and localStorage to save user’s preferences.

I built an app where it requires a user to input several fields to start using the app. The data has to be reentered every time a page refreshes.