def unpack(self, packed): args = json.loads(decrypt(base64.b64decode(packed), JBoxCfg.get('sesskey'))) for oldcookie in self.cookies: if oldcookie not in args or args[oldcookie] is None: self.clear_cookie(oldcookie) for cname, cval in args.iteritems(): if cval is not None: self.set_cookie(cname, cval)
def unpack(self, packed): args = json.loads( decrypt(base64.b64decode(packed), JBoxCfg.get('sesskey'))) for oldcookie in self.cookies: if oldcookie not in args or args[oldcookie] is None: self.clear_cookie(oldcookie) for cname, cval in args.iteritems(): if cval is not None: self.set_cookie(cname, cval)
def get_gtok(self): gtok = self.get_attrib('gtok') return decrypt(gtok, self.enckey()) if (gtok is not None) else None