'handles a Logout response
:param response: A response.Response instance
:return: 4-tuple of (session_id of the last sent logout request,
response message, response headers and message)'

def handle_logout_response(self, response):

    logger.info(('state:    %s' % (self.state,)))
    status = self.state[response.in_response_to]
    logger.info(('status:    %s' % (status,)))
    issuer = response.issuer()
    logger.info(('issuer:    %s' % issuer))
    del self.state[response.in_response_to]
    if (status['entity_ids'] == [issuer]):
        self.local_logout(decode(status['name_id']))
        return (0, '200    Ok', [('Content-type', 'text/html')], [])
    else:
        status['entity_ids'].remove(issuer)
        return self.do_logout(decode(status['name_id']), status['entity_ids'], status['reason'], status['not_on_or_after'], status['sign'])
