Add cookie fallback for localStorage.