Hello, I need to send a post in a form where I type the values of the capctha image, plus when sending the POST to the url, the returned html is like a GET, since it does not come in the html image error message, the Which happens when the form is posted. I can navigate all pages after logging in using cookies, the problem is this page where you have the url with the image capctha
When accessing other pages via browser I can see the following cookie: Cookie:ASPSESSIONIDAGCRRQQD=CMAJDBICILCNFNGNLBNKDPOB; ASPSESSIONIDAGBRQTRC=JMODIFJCAPCPOPGKMONLDHKP But when I access this page with captcha via browser, I have an additional cookie: Cookie:ASPSESSIONIDAGCRRQQD=CMAJDBICILCNFNGNLBNKDPOB; ASPSESSIONIDAGBRQTRC=JMODIFJCAPCPOPGKMONLDHKP; *cookieCaptcha=p5RQtUUhbJWX6lufHZWsh%2bnF2A6NAP8Ai0yCSS6ggyYaQQL%2fMgLH%2fKZn4MSYm8zq* I'm doing this: I get the value of "*IcsCookiesPrincipal*" that logged in, for " *IcsCookiesCpt*" Who will access the form. * HttpCptFim.URL := 'www.urlformcapctha.com/pag.asp?x=1&y=2 <http://www.urlformcapctha.com/pag.asp?x=1&y=2>';* * IcsCookiesCpt.SetCookie(IcsCookiesPrincipal.GetCookies(**HttpCptFim.URL* *), HttpCptFim.URL);* * HttpCptFim.Cookie := IcsCookiesCpt.GetCookies(HttpCptFim.URL);* * HttpCptFim.Get;* Here I get the data correctly, the cookie worked. Now I get a get in the url that only brings the image * HttpCptFim.URL := 'www.urlformcapctha.com/captcha.aspx?opt=image <http://www.urlformcapctha.com/captcha.aspx?opt=image>';* * HttpCptFim.Cookie := IcsCookiesCpt.GetCookies(HttpCptFim.URL);* * HttpCptFim.Get;* Here I get the data correctly, the cookie worked. Now I'm sending the post with the data, here's the problem, because the returned html does not contain the error message when the captcha is wrong, the html returned is the same as the first get * Buf := AnsiString('idCpt=123456&idTom=&Submit=Confirm');* * DataOut := TMemoryStream.Create;* * if Length(Buf) > 0 then* * DataOut.Write(Buf[1], Length(Buf));* * DataOut.Seek(0, soBeginning);* * HttpCptFim.SendStream := DataOut;* * HttpCptFim.RcvdStream := TMemoryStream.Create;;* * HttpCptFim.URL := 'www.urlformcapctha.com/pag.asp?x=1&y=2 <http://www.urlformcapctha.com/pag.asp?x=1&y=2>';* * HttpCptFim.Cookie := IcsCookiesCpt.GetCookies(HttpCptFim.URL);* * HttpCptFim.Post;* OnCookie event *procedure TForm1.HttpCptFimCookie(Sender: TObject; const Data: string;* * var Accept: Boolean);* *begin* * IcsCookiesCpt.SetCookie(Data, (Sender as TSslHttpCli).URL);* *end;* To access this page I need the main cookie that logged in, but it has this additional cookie, I believe that is the problem, how can I resolve this? Why does POST not send data and is it working as GET? thanks!! -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be