简体   繁体   中英

cookies using Delphi 2010 and Indy

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM