Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdHTTP, TIdCookieManager, accepting cookies
Dear All; when using the TIdHTTP and TIdCookieManager components, how do I accept a cookie?

Here's what I'm trying to:

TIdCookieManager *IdCookieManager1;

//IdHTTP1->CookieManager = IdCookieManager1; - set @ design

  IdHTTP1->Get(stringServerURL, myMemoryStream);

with IdHTTP1->AllowCookies set to true, the Server returns OK and I see in the IdHTTP1->OnHeadersAvailable event handler the line "Set-Cookie: ..." shows 5 times (5 different cookies); the IdCookieManager1->OnNewCookie event also fires 5 times; and IdCookieManager1->CookieCollection->Count == 5 after IdHTTP1->Get() returns.

Looks like Indy components do their job but the server response is a 200Kb HTML doc that basically says "your browser blocks cookies...". I did try to set ACookie argument in the IdCookieManager1->OnNewCookie handler call to true but result is the same.

Please assist; many thanks in advance.
Boba TC.

Messages In This Thread
TIdHTTP, TIdCookieManager, accepting cookies - by Boba TC - 04-02-2022, 01:55 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)