Important: Please read the Qt Code of Conduct -

QNetworkAccesManager can't get to another page after NetworkRequest post

  • After I succsesfully send post request and login to page I can't get to another page during same session. for example

    I login to and then webpage redirects me to index.php and from index page I want to go to

    But reply returns me only login.php page.

    Here is my code

    @QNetworkAccessManager *manager;
    manager = new QNetworkAccessManager ();
    QNetworkRequest req;

    address =("www.example/index.php");

        manager->setCookieJar(new QNetworkCookieJar);
        req.setHeader(req.UserAgentHeader,"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2");
            QByteArray postData;
    connect (manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(writeToTxt(QNetworkReply  *))); 
    manager->post(req, postData);

    I just have no idea where to start searching for problem. Post any ideas i will really appreciate them.

    And sorry English is not my native language.

  • you should get session ID from webpage and keep that to GET or POST .

Log in to reply