S
superplayboy
Unregistered / Unconfirmed
GUEST, unregistred user!
在HTTP控件的ONCOOKIE事件中加上
httpcli1.Cookie:=data;
即可
测试过程:
建立两个ASP文件
t.asp
=============
<%
session("aa")=true
%>
tt.asp
==============
<%
if session("aa") then response.write "ok" else response.write "no ok"
%>
在窗体中建立2个BUTTON
procedure TForm1.Button1Click(Sender: TObject);
begin
httpcli1.URL:='http://localhost/t.asp';
httpcli1.Get;
end;
---------------------------------------------
procedure TForm1.Button2Click(Sender: TObject);
begin
httpcli1.URL:='http://localhost/tt.asp';
httpcli1.Get;
showmessage(httpcli1.LastResponse);
end;
==================================
在没有按下BUTTON1之前,点BUTTON2显示的是no ok
点了BUTTON1之后再点BUTTON2可以看到显示的是ok
所以HTTP控件保存了服务器端的SESSION
httpcli1.Cookie:=data;
即可
测试过程:
建立两个ASP文件
t.asp
=============
<%
session("aa")=true
%>
tt.asp
==============
<%
if session("aa") then response.write "ok" else response.write "no ok"
%>
在窗体中建立2个BUTTON
procedure TForm1.Button1Click(Sender: TObject);
begin
httpcli1.URL:='http://localhost/t.asp';
httpcli1.Get;
end;
---------------------------------------------
procedure TForm1.Button2Click(Sender: TObject);
begin
httpcli1.URL:='http://localhost/tt.asp';
httpcli1.Get;
showmessage(httpcli1.LastResponse);
end;
==================================
在没有按下BUTTON1之前,点BUTTON2显示的是no ok
点了BUTTON1之后再点BUTTON2可以看到显示的是ok
所以HTTP控件保存了服务器端的SESSION