Link to home
Start Free TrialLog in
Avatar of 65zgtre45rr
65zgtre45rr

asked on

Indy Http cookies ?

I need some one to write me some example to use cookies with indy http control.

Example:
- send post request to site
- accept cookies from site
- make another post request and send cookie from first request

Thank you !
Avatar of 2266180
2266180
Flag of United States of America image

check the 2 peristent connection examples from here:
http://www.ciuly.com/delphi/indy/
Avatar of 65zgtre45rr
65zgtre45rr

ASKER

It is not useful to me because it is using TIdCookieManager. I need example of code that uses TIdHTTP.AllowCookies and TIdHTTP.CookieManager for delphi 8
what type is TIdHTTP.CookieManager in delphi 8? isn't it of type TIdCookieManager? because if I am correct, delphi 8 would have indy 10 which I believe still has TIdCookieManager. of course it's been some time since I last worked with indy 10 (was too buggy at the time) and I am still on indy 9.
I have find how to set cookie

idHTTP1.CookieManager.AddCookie('test=bla', 'localhost');

Now i need example how to get cookies.
you did not answer my question. is idHTTP1.CookieManager of type TIdCookieManager or not? if not, what type is it? because I believe it is. in which case my examples apply maybe with some small modifications.
I think that it is.
ASKER CERTIFIED SOLUTION
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I thin i solved the problem, i only need to do:
IdHTTP1.CookieManager.CookieCollection.Count;

and cookies will be set in new request.
just reading that property made it send the cookies at new request? that is pretty weird. guess I'll have to install indy 10 sometime and check out the behaviour myself.