def auth_check(self): """ Check session """ is_sessioned = False if 'ssid' in self.request.cookies: data = crypto.decode_data(self.request.cookies['ssid']) if data: is_sessioned = True self.username, self.password, self.sub_id, \ self.subdomain = data return is_sessioned
def auth_check(self): """ Check session """ is_sessioned = False if 'ssid' in self.request.cookies: ssid = self.request.cookies['ssid'] try: (self.username, self.password, self.sub_id, self.subdomain) = crypto.decode_data(ssid) except crypto.DecodeError: pass else: is_sessioned = True return is_sessioned