これは、Intraweb12.2.8XE2でCookieを作成する作業コードブロックです。
必ずuses句にIW.HTTP.Cookieを追加してください。
もちろん、iwformに一致するようにTiwfrmMainを変更し、プロシージャを宣言する必要があります:) via:procedure MakeCookie; あなたの中で
procedure TiwfrmMain.MakeCookie;
var cookieMain: THttpCookie;
begin
try
cookieMain:= THttpCookie.Create('email',editLogin.Text,'',Date + 999);
WebApplication.Response.Cookies.Add(cookieMain);
cookieMain.free;
except
end;
end;
そして、次の方法で入手することもできます。
procedure TiwfrmMain.SetCookie;
begin
try
if WebApplication.Request.CookieFields.IndexOfName('email')> -1 then
editLogin.Text := WebApplication.Request.CookieFields.Values['email'];
except
end;
end;
njoy :)