Use cookie instead of local/sessionStorage.