class LogoutHandler(BaseHandler): """退出登录""" def get(self): self.session = Session(self) # 清除session数据 self.session.clear() self.write(dict(errcode=RET.OK, errmsg="退出成功"))
class LogoutHandler(BaseHandler): def get(self): try: self.session = Session(self) self.session.clear() except Exception as e: print "hahah" logging.error(e) return self.write(dict(errno=RET.OK, errmsg="OK"))
class LogoutHandler(BaseHandler): """退出登陆""" @required_login def get(self): # 清除session信息 self.session = Session(self) self.session.clear() # 处理完成 self.write({'errcode': RET.OK})
def get(self): session = Session(self) sess_id = session.session_id session.clear() # 判断是否删除session数据 user = self.redis.get('sess_id_%s' % sess_id) if not user: self.write(dict(errcode=RET.OK, errmsg='登出成功')) else: self.write(dict(errcode=RET.DBERR, errmsg='登出失败'))
class LogOffHandler(BaseHandler): def post(self): try: self.session = Session(self) self.session.clear() except Exception as e: logging.error(e) return self.write(dict(error_code=RET.SESSIONERR, error_msg="退出失败")) self.write(dict(error_code=RET.OK, error_msg="ok"))
def get(self, *args, **kwargs): session = Session(self) session.clear() self.write(dict(errcode=RET.OK, errmsg="退出成功"))
def get(self): # 清除session数据 session = Session(self) session.clear() self.write(dict(errcode=RET.OK, errmsg="退出登录成功"))
def get(self): session = Session(self) session.clear() self.render("index.html")
def delete(self): session = Session(self) session.clear() self.clear_all_cookies() self.write(dict(errcode=RET.OK, errmsg=RMS.OK))
def get(self): session = Session(self) session.clear() return self.write(dict(errorno=RET.OK, errmsg=u'已登出'))
class LogoutHandler(BaseHandler): def get(self): self.session = Session(self) self.session.clear() self.write({"errno": RET.OK, "errmsg": "ok"})