Skip to content
  • ntome's avatar
    weboob.browser.browsers: no pickling when saving cookie jar in StatesMixin · 140ce810
    ntome authored
    pickle may be unsafe for loading data. All we want is a cookie jar, we
    can just serialize its cookies, not necessarily the whole jar with its
    type and policy.
    
    Old format is base64(compress(pickle(jar))).
    New format is base64(compress(json(jar))) where JSON conversion is on
    the list of cookies (taking name, value, domain, path, secure (https)
    and expires).
    
    dump_state will now save using the new format while load_state supports
    both new and old format. This allows compatibility for some time, then
    later old format support in load_state will be dropped too.
    140ce810