Using window.localStorage instead of cookies