def unregister(self, **kwargs): _session_id = kwargs["_session_id"] if "session_id" in cherrypy.request.cookie: cherrypy.response.cookie = cherrypy_logout(_session_id) _peer = self.peers[_session_id] if "websocket" in _peer: try: _peer["websocker"].close() write_to_log(_data="Unregister: Closed websocket for address " + _peer["address"] + ".", _category=EC_COMMUNICATION, _severity=SEV_DEBUG) except: write_to_log(_data="Unregister: Failed closing websocket for address " + _peer["address"] + ".", _category=EC_COMMUNICATION, _severity=SEV_ERROR) del self.peers[_session_id] return {}
def logout(self, **kwargs): cherrypy.response.cookie = cherrypy_logout(kwargs["_session_id"]) return {}