4
votes

I'm new to dealing with cookies and not sure if my code or maybe Indy version is the problem based on researching other posts.

Using Delphi 2010 and Indy 10.5.5.

Have set up a cookiemanager at design time. I can send an initial login request (using the POST method) to the server that is successful (get a "success" code back from the server app) and the cookie manager shows that it has accepted a cookie from the server.

When I try to reply to the server (again using POST) to get the next set of information, I get an error code back from the server app which indicates an authorization failure and I'm being told by the server tech support people to check the cookie being sent with the reply.

How can I check the contents of the cookie header that is being sent back to the server? Also, in another post I saw that Indy 10 IdCookieManager.pas and IdCookie.pas have been updated in 2011. Should I update my Indy to the latest version as this might be my problem?

Thanks in advance.


Here is some more info:

Thank you for your previous assistance; I appear to be getting closer to reinstalling Indy10.

I purged my system of all Indy stuff except the most recent version (10.5.8) which I downloaded yesterday. [Actually I just moved the old stuff into a directory with an unusual name.]

Now I get a clean compile on all 5 packages.

I was able to add the two main packages (the ones starting with dcl) to my program's project list.

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

I tried removing and reinstalling the dcl packages to my project. When I removed them, I got the message that IndyCore and 3 other packages would also be removed - so it seems to know that dclIndyCode140 uses IndyCore140.

I've added some directories to my search path and tried placing the 5 bpl's in different directories. None of that had any effect and at this point I am stumped.

Ideas? Suggestions?

Steve

1
Indy has a version number, which may be a lot more helpful than a file date. Right-click on any Indy component on your form, and the version number is in the top item of the context menu. You can edit your post to mention the version number instead of the date you have now. It may improve your chances of getting an answer quickly. :) - Ken White
Updating to Indy 10.5.8 is the first I would try to do. I also do not install the Indy packages, I just add Indy to the project path and create components at run time. - mjn

1 Answers

1
votes

Upgrading to the latest release is definate recommended. Links are on Indy`s website. Yes, cookie support was broken in earlier Indy 10 releases but it working again now.

As for your other question, to see what TIdHTTP is sending, you have a few choices:

  1. Look at the TIdHTTP.Request.RawHeaders property after sending a request.

  2. Attach one of Indy's TIdLog... components to TIdHTTP, such as TIdLogFile, and look at the output.

  3. Use an external packet sniffer, such as Wireshark.