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

QNetworkCookieJar::cookiesForUrl does not return cookies set with setCookiesFromUrl

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.9.3
    • Component/s: Network: Cookies
    • Labels:
      None
    • Environment:
      Chakra with kde-next repositories.
    • Commits:
      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

            Assignee:
            manordheim Mårten Nordheim
            Reporter:
            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