Hi!

I would like to use QtWebkit to log in to a site, and then download some data.Unfortunately if I load the page with the webkit( QWebView::load()) I cant log in, and the site claims that I don't have cookies enabled, even though I have created a QNetworkCookieJar, and set it to the QNetworkAccessManager of the page.

here's a piece of my code:

Qt Code:
  1. Downloader::Downloader(QWidget *parent)
  2. : QMainWindow(parent), ui(new Ui::DownloaderClass),state(First)
  3. {
  4. manager=new QNetworkAccessManager();
  5. jar=new MyCookieJar();
  6. manager->setCookieJar(jar);
  7. view=new QWebView();
  8. view->setMinimumSize(800,600);
  9. connect(view,SIGNAL(loadFinished(bool)),this,SLOT(loaded(bool)));
  10. view->load(QUrl("http://portfolio.hu/users/elofizetes_info.php?t=koteslista"));
  11. QWebSettings::globalSettings()->setOfflineStoragePath("C:\\Users\\Zsolt\\Desktop\\");
  12. }
To copy to clipboard, switch view to plain text mode 

the MyCookieJar is a subclass of QNetworkCookieJar class and only implements a getCookies() function, returning all the coookies stored ( the QNetworkCookieJar::allCookies() function is protected). In the loaded(bool) function i print all the cookies stored.
I only got a "cookie = 1;", and normally i would have a lot more( checked with wireshark).
And since i can only set the QNetworkAccessManager to a page, i do that every time the view loads one.

I tried to manually copy the protocol, and save the cookies, using QHttp, and the headers, but apparently some javascript code generates an ID to be sent to the site when logging in.

Please help me log in(and stay logged in) either with using QtWebkit, or with simple QHttp classes.

Any reply would be appreciated.