P
pyliu
Unregistered / Unconfirmed
GUEST, unregistred user!
我象下面这样存COOKIE再取出COOKIE为什么取不出来呢?
请高手帮忙?
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
MyCookies: TStringList;
begin
//Response.Content := Request.PathInfo;
//Exit;
if Request.PathInfo = '/aaa' then begin
MyCookies := TStringList.Create;
with MyCookies do begin
Add('Name=Pyliu');
Add('Address=Shang');
Add('Product=CGIIII');
end;
with Response do begin
SetCookieField(MyCookies, 'localhost', '/', (Now + 1), False);
Content := 'Cookie Added!';
end;
end
else begin
Response.Content := Request.CookieFields.Values['Name']+ ' okp';
end;
end;
请高手帮忙?
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
MyCookies: TStringList;
begin
//Response.Content := Request.PathInfo;
//Exit;
if Request.PathInfo = '/aaa' then begin
MyCookies := TStringList.Create;
with MyCookies do begin
Add('Name=Pyliu');
Add('Address=Shang');
Add('Product=CGIIII');
end;
with Response do begin
SetCookieField(MyCookies, 'localhost', '/', (Now + 1), False);
Content := 'Cookie Added!';
end;
end
else begin
Response.Content := Request.CookieFields.Values['Name']+ ' okp';
end;
end;