moving cookie check to base handler