localStorage and logout functionality