refactored cookie check into service 6