localStorage with cookie fallback