Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44860

QNetworkCookieJar::cookiesForUrl does not return cookies set with setCookiesFromUrl

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.3
    • 5.4.1
    • Network: Cookies
    • None
    • Chakra with kde-next repositories.
    • fc988786588bf86ebc46fdd12629efbec8ae1841

    Description

      I was debugging a failed test after porting KDE's libmediawiki to KF5, and I end up with the following code to cleanly reproduce the issue:

      // TEST
      QUrl url(QStringLiteral("http://example.com"));
      QNetworkCookieJar* cookieJar = new QNetworkCookieJar(this);
      QNetworkCookie cookie("key", "value");
      QList<QNetworkCookie> cookies;
      cookies.append(cookie);
      qDebug() << "Cookies set:" << cookies.count(); // 1
      cookieJar->setCookiesFromUrl(cookies, url);
      qDebug() << "Cookies received:" << cookieJar->cookiesForUrl(url).count(); // 0
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            gallaecio Adrián Chaves Fernández
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes