use localStorage instead of sessionStorage

Use localStorage in getLocalStorage() feature detection.
Code simplified. try-catch is enough.