Save and load local data with localStorage and cookies.