refactored cookie controller and extracted hasCookie and createCookie services