> Whats the easiest/fastest way to implement automatic cookies support
> to HTTPCli? I mean automaticly use cookies sent by server (replace
> existing cookies if they are available already).
> I know that i should just write a code to OnCookie event, but how
> should it look like so it would work the best?

You have to write a cookie manager (and maybe give it to the ICS community).
Not very difficult to write. A cookie is a quartet: name, value, path and
expiration date. The name is the key.

To implement a cookie manager, create a new component (TCookieManager),
embbed a TStringList to stroe the cookies names. A TStringList can have an
object associated with each string so it is easy to create a small object
(TCookieObject) with value, path and expiration date data, and probably a
few methods to handle them.

TCookieManager could have methods such as
procedure TCookieManager.AddCookie(const Name, Value, Path : String;
Expiration : TDateTime);
function GetCookieValue(const Path : String) : String;
procedure SaveToStream;
procedure LoadFromStream;
procedure Clear;
procedure RemoveTimedout;
and maybe some other method you could think of...

Once the CookieManager is operating, and you have a wroking application
using it thru the HTTP component events, it will be easier to add a property
CookieManager into the HTTP component and make it's use as transparent as
possible.

That was just some ideas I have...


btw: Please do not post messages with high priority flag toggled on. Your 
messages are not more urgent than messages from others.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to