def logout(self):
if not hasattr(self, "basicAuth") or not hasattr(self, "cookiejar"):
return
if self.basicAuth or not self.cookiejar:
return
# check our cookie and logout if needed
for cookie in self.cookiejar:
if cookie.name == "auth":
# this following part is just mimicking the webui
cookieIndex = ord(cookie.value[0]) - ord("a")
self.setAttribute("M1", 40038, chr(cookieIndex), 0)
# remove the cookie from our jar
self.cookiejar.clear(cookie.domain, cookie.path, cookie.name)
break
评论列表
文章目录