【发布时间】:2018-12-19 09:26:54
【问题描述】:
我有 Indy 10.6、Windows 10 和 Delphi XE7。
在响应 HTTPS GET 请求时,CookieManager 声明没有 cookie,但 HTTP 分析器显示有:
HTTP/1.1 200 OK
Date: Wed, 11 Jul 2018 10:47:22 GMT
Server: Apache
Cache-Control: no-cache
Pragma: No-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Frame-Options: DENY
Set-Cookie: JSESSIONID=vqf9bFgB0wp1vyznZTQ2TLGzpQbpYQTgnwqhtvQpl2D0JdsrpH8G!-32035106!wls-baap401.test.vocalink.co.uk!13129!13109; path=/; HttpOnly
Content-Type: text/xml; charset=UTF-8
Content-Length: 162
我的代码是:
html := IdHTTP1.Get(Login);
Cookies := IdCookieManager1.CookieCollection.LockCookieList(caRead);
try
for I := 0 to Cookies.Count-1 do
begin
Cookie := Cookies[I];
// save Cookie as needed...
end;
finally
IdCookieManager1.CookieCollection.UnlockCookieList(caRead);
end;
但是Cookies.Count 是 0。
有什么想法吗?
【问题讨论】:
标签: delphi cookies indy delphi-xe7 indy10