def checkLogin(self): """Checks the users cookie for authenticity. If it fails, deletes the cookie""" uid = self.request.cookies.get('uid') if uid: check = utils.checkCookie(uid) if check: u = User.getId(uid.split('|')[0]) return u else: self.delCookie('uid') return None
def dispatch(self): self.username = utils.checkCookie(self.request.cookies.get("PBLOGIN")) if self.username != None: super(LoginRequiredHandler, self).dispatch() else: self.abort(403)
def dispatch(self): self.username = utils.checkCookie(self.request.cookies.get("PBLOGIN")) super(CheckLoginHandler, self).dispatch()