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 !
Example:
- send post request to site
- accept cookies from site
- make another post request and send cookie from first request
Thank you !
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.
ASKER
I have find how to set cookie
idHTTP1.CookieManager.AddC ookie('tes t=bla', 'localhost');
Now i need example how to get cookies.
idHTTP1.CookieManager.AddC
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.
ASKER
I think that it is.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I thin i solved the problem, i only need to do:
IdHTTP1.CookieManager.Cook ieCollecti on.Count;
and cookies will be set in new request.
IdHTTP1.CookieManager.Cook
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.
http://www.ciuly.com/delphi/indy/