def expire_cookies(session = false)
      @domains.delete_if do |_domain, paths|
        paths.delete_if do |_path, cookies|
          cookies.delete_if do |_cookie_name, cookie|
            cookie.expired? || (session && cookie.session?)
          end
          cookies.empty?
        end
        paths.empty?
      end
    end
def expire_cookies(session = false)
      @domains.delete_if do |_domain, paths|
        paths.delete_if do |_path, cookies|
          cookies.delete_if do |_cookie_name, cookie|
            cookie.expired? || (session && cookie.session?)
          end
          cookies.empty?
        end
        paths.empty?
      end
    end
Look through the jar for any cookies which have passed their expiration
 date, or session cookies from a previous session

 @param session [Boolean] whether session cookies should be expired,
   or just cookies past their expiration date.