QNetworkCookieJar doesn't know anything about other browser application cookie caches, any more than IE knows about Chrome's cookies.
If you want to persist the cookie jar then you do what the friendly manual says:
The class provides several methods to access the cookies in the jar to read or write to file.QNetworkCookieJar does not implement permanent storage: it only keeps the cookies in memory. Once the QNetworkCookieJar object is deleted, all cookies it held will be discarded as well. If you want to save the cookies, you should derive from this class and implement the saving to disk to your own storage format.
If you want the QNetworkCookieJar to be a proxy to some other browser's cookie cache then you should subclass and read (at least) the other browser's cookie cache. How you do that is entirely dependent on the other browser, and it may not work if the other browser's cookies (particularly transient session cookies) have not been written to somewhere you can access them.
You could just have the user log in using a Qt web view or form and submit the login request via your QNetworkAccessManager to capture the cookies.




Reply With Quote
Bookmarks