使用 Delphi 2010 和 Indy 的 cookies

发布于 2024-12-29 22:25:03 字数 934 浏览 0 评论 0原文

我是处理 cookie 的新手,根据研究其他帖子,不确定我的代码或 Indy 版本是否是问题所在。

使用Delphi 2010和Indy 10.5.5。

在设计时已经设置了cookiemanager。我可以向成功的服务器发送初始登录请求(使用 POST 方法)(从服务器应用程序返回“成功”代码),并且 cookie 管理器显示它已接受来自服务器的 cookie。

当我尝试回复服务器(再次使用 POST)以获取下一组信息时,我从服务器应用程序收到一个错误代码,表明授权失败,服务器技术支持人员告诉我检查与回复一起发送的 cookie。

如何检查发送回服务器的 cookie 标头的内容? 另外,在另一篇文章中,我看到 Indy 10 IdCookieManager.pas 和 IdCookie.pas 已于 2011 年更新。我是否应该将 Indy 更新到最新版本,因为这可能是我的问题?

提前致谢。


以下是更多信息:

感谢您之前的帮助;我似乎距离重新安装 Indy10 越来越近了。

我清除了系统中的所有 Indy 内容,除了昨天下载的最新版本(10.5.8)。 [实际上我只是将旧的东西移到一个具有不寻常名称的目录中。]

现在我对所有 5 个包进行了干净的编译。

我能够将两个主要包(以 dcl 开头的包)添加到我的程序的项目列表中。

但我收到“[DCC 致命错误] E2202 未找到所需的包 IndyCore”。当我尝试编译我的主程序时。

我尝试删除 dcl 软件包并将其重新安装到我的项目中。当我删除它们时,我收到消息说 IndyCore 和其他 3 个包也将被删除 - 所以它似乎知道 dclIndyCode140 使用 IndyCore140。

我已在搜索路径中添加了一些目录,并尝试将 5 个 bpl 放在不同的目录中。这些都没有任何效果,此时我被难住了。

有想法吗?建议?

史蒂夫

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦纸 2025-01-05 22:25:03

绝对建议升级到最新版本。链接位于 Indy 网站。是的,Cookie 支持在早期的 Indy 10 版本中被破坏,但现在又可以正常工作了。

至于您的其他问题,要查看 TIdHTTP 发送的内容,您有几种选择:

  1. 发送请求后查看 TIdHTTP.Request.RawHeaders 属性。

  2. 将 Indy 的 TIdLog... 组件之一附加到 TIdHTTP,例如 TIdLogFile,然后查看输出。

  3. 使用外部数据包嗅探器,例如 Wireshark。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文