U
ufo!
Unregistered / Unconfirmed
GUEST, unregistred user!
写cookies的代码如下(在idhttpserver 的 IdHTTPServer1CommandGet事件内)
procedure TForm1.IdHTTPServer1CommandGet(AThread: TIdPeerThread;
RequestInfo: TIdHTTPRequestInfo; ResponseInfo: TIdHTTPResponseInfo);
begin
ResponseInfo.Cookies.Add.Name:= 'ufo';
ResponseInfo.Cookies.Add.Value:= 'ufo2';
ResponseInfo.Cookies.Add.Domain:= requestinfo.RemoteIP;
ResponseInfo.Cookies.Add.Path:= '/';
ResponseInfo.Cookies.Add.MaxAge:= 1;
ResponseInfo.ContentText:= 'Ok';
end;
能在页面中返回 ok,但cookies就是没写进去。不知问题在哪里?
procedure TForm1.IdHTTPServer1CommandGet(AThread: TIdPeerThread;
RequestInfo: TIdHTTPRequestInfo; ResponseInfo: TIdHTTPResponseInfo);
begin
ResponseInfo.Cookies.Add.Name:= 'ufo';
ResponseInfo.Cookies.Add.Value:= 'ufo2';
ResponseInfo.Cookies.Add.Domain:= requestinfo.RemoteIP;
ResponseInfo.Cookies.Add.Path:= '/';
ResponseInfo.Cookies.Add.MaxAge:= 1;
ResponseInfo.ContentText:= 'Ok';
end;
能在页面中返回 ok,但cookies就是没写进去。不知问题在哪里?