подскажите как правильно работать с куками, совсем замучился
/*http://stg530.ifolder.ru/download/?15601599&0jQ6ARzHEYyowoFLW%2BHSUykGrFS0NDAdF%2BIPTWuXyGk%3D
(ответ кука в Konqeror)15601599,,smys.ifolder.ru,,0jQ6ARzHEYyowoFLW%2BHSUykGrFS0NDAdF%2BIPTWuXyGk%3D,,0,,0
*/
void MainWindow::push()
{
QString forurl=ui->lineEdit->text();
QUrl url(forurl);
QNetworkRequest rec(url);
QNetworkAccessManager *manager=new QNetworkAccessManager (this);
QList<QNetworkCookie> a;
QNetworkCookie ept;
ept.parseCookies("?15601599&0jQ6ARzHEYyowoFLW%2BHSUykGrFS0NDAdF%2BIPTWuXyGk%3D");
a.append(ept);
QNetworkCookieJar CJ;
CJ.setCookiesFromUrl(a,url);
manager->setCookieJar(&CJ);
file.setFileName("hervam.txt");
file.open(QIODevice::WriteOnly);
rep=manager->head(rec);
connect(rep,SIGNAL(readyRead()),this,SLOT(print()));
connect(rep,SIGNAL(finished()),this,SLOT(finished()));
connect(rep,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(Error(QNetworkReply::NetworkError)));
rep=manager->get(rec);
QList<QByteArray> b=rec.rawHeaderList();
QString c;
while(!b.isEmpty()){
c.append(b.first());
b.removeFirst();
}
if(!c.isEmpty())ui->label->setText(c);
}
void MainWindow::print()
{
file.write(rep->readAll());
}
void MainWindow::finished()
{
file.close();
}
void MainWindow::Error(QNetworkReply::NetworkError a)
{
ui->label_2->setText(QString().number(a));
}