Проблема с куками при заходе на сайт.
Кто знает,пожалуста напишите строку,где я поставил комментарий.
Код:
procedure TForm1.Button1Click(Sender: TObject);
const
fact:shortString = 'http://torrents.ru/forum/login.php';
var
fGet,fPost:TStringList;
begin
fGet:=TStringList.Create;
fPost:=TStringList.Create;
IdHTTP1.AllowCookies:=true;
IdHTTP1.CookieManager:=IdCookieManager1;
IdHTTP1.HandleRedirects:=true;
With fPost do
begin //with
Add('redirect=index.php');
Add('cookie_test='); //тут не знаю что прописывать
Add('login_username=MyUser');
Add('login_password=MyPass');
Add('autologin=on');
Add('login=Вход');
end; //with
fGet.Text:=IdHTTP1.Post(fact,fPost);
If fGet.IndexOf('Вы зашли как:') <> - 1 then
MessageBOX(Application.Handle,'Залогинились!','Удачно!',mb_OK)
else
MessageBOX(Application,Handle,'Ошибка!','Неудачно!',mb_OK);
IdHTTP1.Free;
IdCookieManager1.Free;
fGet.Free;
fPost.Free;
end;
Данные,которые отправляет браузер на сайт(смотрел сниффером) :
Код:
redirect=index.php
cookie_test=xxxxxxxxxx
login_username=MyUser
login_password=MyPass
autologin=on
login=Вход