'Login a user by name, returning her cookies.'

@gen.coroutine
def login_user(self, name):

    base_url = public_url(self)
    r = (yield async_requests.post((base_url + 'hub/login'), data={'username': name, 'password': name}, allow_redirects=False))
    r.raise_for_status()
    assert r.cookies
    return r.cookies
