Add check before destroy cookie