'Set login cookies for the Hub and single-user server.'

def set_login_cookie(self, user):

    if (self.subdomain_host and (not self.request.host.startswith(self.domain))):
        self.log.warning('Possibly    setting    cookie    on    wrong    domain:    %s    !=    %s', self.request.host, self.domain)
    if self.db.query(orm.Service).filter((orm.Service.server != None)).first():
        self.set_service_cookie(user)
    if (not self.get_current_user_cookie()):
        self.set_hub_cookie(user)
