🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #185

AResponseInfo.AddCookie and IdCookiemanager BUG!!!

#185
From: JoeAley2003
Date: Mon, 15 Mar 2004 20:29
37 lines
2290 bytes
Hi all...

I'm trying to do an anonymizer proxy with indy.

I Use a TIdHTTPServer and for each request in the OnCommandGet Event,
i make a new instance of a TIdHTTP (client) (with a TIdCookieManager
instance assigned) then i do the good request and get the response
normally. it works, but the cookies must be written to my client too. 

So, i wrote on OnCommandGetEvent of TidHTTPSERVER

       IdHTTP.Get(MyGetStr,GetStream);

       i := 0;
       while(i < IdHTTP.CookieManager.CookieCollection.Count) do
         begin         
AResponseInfo.Cookies.AddCookie(IdHTTP.CookieManager.CookieCollection.Items[i]);
           Inc(i);
         end;

       //Here we can check that the count number of cookies in
ResponseInfo type was not incresed, it is still zero!!!

       if(AResponseInfo.Cookies.Count = 0) then
         begin
           Form1.Memo.Lines.Add('NO, THE COOKIE IS NOT WORKING!!!');
//Always
         end;

Since the types are the same and i can watch the cookies in
IdHTTP.CookieManager.CookieCollection.Items[i], the AddCookie function
is not working!!!

By the way, how could i write these cookies to my clients? Should i
write it in ContentText?

Thank you all!
Technical Details
Message-ID: <79d8d5b3.0403151229.430df51e@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd817,3cb31c2a42074a85,start
X-Google-Attributes: gidfd817,public
X-Google-Thread: 1036eb,3cb31c2a42074a85,start
X-Google-Attributes: gid1036eb,public
X-Google-Thread: 10baee,3cb31c2a42074a85,start
X-Google-Attributes: gid10baee,public
X-Google-ArrivalTime: 2004-03-15 12:29:18 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mail
From: joealey2003@yahoo.com (JoeAley2003)
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.internet.winsock
Subject: AResponseInfo.AddCookie and IdCookiemanager  BUG!!!
Date: 15 Mar 2004 12:29:17 -0800
Organization: http://groups.google.com
Lines: 37
Message-ID: <79d8d5b3.0403151229.430df51e@posting.google.com>
NNTP-Posting-Host: 200.167.252.203
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1079382558 2995 127.0.0.1 (15 Mar 2004 20:29:18 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 15 Mar 2004 20:29:18 +0000 (UTC)