fix issue: NPE if no cookie