result = manifold_api.forward(query.to_dict())
if result['code'] == 2:
# this is gross; at the very least we need to logout()
# but most importantly there is a need to refine that test, since
# code==2 does not necessarily mean an expired session
# XXX only if we know it is the issue
result = manifold_api.forward(query.to_dict())
if result['code'] == 2:
# this is gross; at the very least we need to logout()
# but most importantly there is a need to refine that test, since
# code==2 does not necessarily mean an expired session
# XXX only if we know it is the issue