code: def _build_cookie_jar(cls, session: AppSession):
          '''Build the cookie jar'''
  
          if not session.args.cookies:
              return
  
          if session.args.load_cookies or session.args.save_cookies:
              session.factory.set('CookieJar', BetterMozillaCookieJar)
  
              cookie_jar = session.factory.new('CookieJar')
  
              if session.args.load_cookies:
                  cookie_jar.load(session.args.load_cookies, ignore_discard=True)
          else:
              cookie_jar = session.factory.new('CookieJar')
  
          policy = session.factory.new('CookiePolicy', cookie_jar=cookie_jar)
  
          cookie_jar.set_policy(policy)
  
          _logger.debug(__('Loaded cookies: {0}', list(cookie_jar)))
  
          cookie_jar_wrapper = session.factory.new(
              'CookieJarWrapper',
              cookie_jar,
              save_filename=session.args.save_cookies,
              keep_session_cookies=session.args.keep_session_cookies,
          )
  
          return cookie_jar_wrappef _build_cookie_jar(cls, session: AppSession):
          '''Build the cookie jar'''
  
          if not session.args.cookies:
              return
  
          if session.args.load_cookies or session.args.save_cookies:
              session.factory.set('CookieJar', BetterMozillaCookieJar)
  
              cookie_jar = session.factory.new('CookieJar')
  
              if session.args.load_cookies:
                  cookie_jar.load(session.args.load_cookies, ignore_discard=True)
          else:
              cookie_jar = session.factory.new('CookieJar')
  
          policy = session.factory.new('CookiePolicy', cookie_jar=cookie_jar)
  
          cookie_jar.set_policy(policy)
  
          _logger.debug(__('Loaded cookies: {0}', list(cookie_jar)))
  
          cookie_jar_wrapper = session.factory.new(
              'CookieJarWrapper',
              cookie_jar,
              save_filename=session.args.save_cookies,
              keep_session_cookies=session.args.keep_session_cookies,
          )
  
          return cookie_jar_wrapper
docs: Build the cookie jar