use localStorage instead of cookies