【发布时间】:2018-12-07 10:33:23
【问题描述】:
如何在 idhttpserver 中创建会话?
我尝试了很多方法,但我无法在 ARequestInfo.Session 或 AResponseInfo.Session 中访问会话对象,它们都始终为零。请帮忙
procedure TFolsecPermissionManager.IdHTTPServerCommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
Command: TCommand;
Session: TIdHTTPSession;
begin
Session := IdHTTPServer.CreateSession(AContext, AResponseInfo, ARequestInfo);
IdHTTPServer.SessionList.Add(Session);
Command:= TCommand.Create;
Command.Start(AContext, ARequestInfo, AResponseInfo);
end;
【问题讨论】:
-
在旁注中,您正在泄漏您的
TCommand对象,因为您在使用完毕后并没有释放它
标签: delphi indy httpserver indy10