Fall back to cookie if local storage is unavailable