Cookies using Delphi 2010 and Indy

I am new to cookies and am not sure if my code, or possibly the Indy version, is a problem based on an examination of other messages.

Using Delphi 2010 and Indy 10.5.5.

Created cookiemanager during development. I can send an initial login request (using the POST method) to a successful server (get the success code from the server application), and the cookie manager shows that it accepted the cookie from the server.

When I try to respond to the server (using POST again) to get the next set of information, I get an error code from the server application, which indicates an authorization failure, and they inform me of the server’s technical support to check if a cookie has been sent with the response.

How can I check the contents of the cookie header sent back to the server? In addition, in another post, I saw that Indy 10 IdCookieManager.pas and IdCookie.pas were updated in 2011. Should I upgrade my Indy to the latest version as this may be my problem?

Thanks in advance.


Here is some more info:

Thanks for your previous help; I seem to be approaching reinstalling Indy10.

I cleaned my system of all Indy materials, except for the latest version (10.5.8), which I downloaded yesterday. [Actually, I just moved the old stuff to a directory with an unusual name.]

Now I get a clean compilation on all 5 packages.

I managed to add two main packages (those starting with dcl) to the list of my software projects.

But I get "[DCC Fatal Error] E2202 Required IndyCore package not found." when I try to compile my main program.

I tried uninstalling and reinstalling dcl packages in my project. When I deleted them, I received a message stating that IndyCore and 3 other packages will also be removed - so it looks like dclIndyCode140 is using IndyCore140.

I added several directories to my search path and tried to put 5 bits in different directories. None of this had any effect, and at that moment I am at an impasse.

Ideas? Suggestions?

Steve

+4
source share
1 answer

It is recommended to upgrade to the latest version. Links are on the Indy website . Yes, cookie support was broken in previous versions of Indy 10, but now it works again.

As for your other question, to see what TIdHTTP sends, you have several options:

  • Look at the TIdHTTP.Request.RawHeaders property after sending the request.

  • Attach one of the Indy TIdLog... components to TIdHTTP , such as TIdLogFile , and look at the result.

  • Use an external packet sniffer like Wireshark.

+1
source

Source: https://habr.com/ru/post/1394095/


All Articles