delphi中可不可以读写cookies ?????????? 分不够可以加分.

蝈蝈俊 2000-07-05 05:28:00
delphi中可不可以读写cookies ??????????
可以的话,请给出范列
...全文
142 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ymxxm 2000-07-07
  • 打赏
  • 举报
回复
可以。
根据网景关于Cookies规定:
COokies只能用特定日期格式,请用FormatDatetime转换日期格式
procedure TWebModule1.PasswordCookieActionAction(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin
Handled := False; { adding a cookie does not handle the request }
with Response.Cookies.Add do
begin
Name := 'LastPassword';
{ Set the LastPassword cookie to the current authorization }
{ Or, if no authorization was supplied this time, carry over }
{ the authorization from the LastPassword cookie of the request }
Value := Request.Authorization;
if Value = '' then
Value := Request.CookieFields.Values('LastPassword');

Secure := True; { be sure to use a secure connection!!!!}
Expires := Now + 1; { this cookie expires in one day }
end;
end;
蝈蝈俊 2000-07-06
  • 打赏
  • 举报
回复
那的isapi ????????

supershan 2000-07-06
  • 打赏
  • 举报
回复
当然可以,
看一下ISAPI的例子
newred 2000-07-06
  • 打赏
  • 举报
回复
好象DELPHI内幕里有讲
kxy 2000-07-06
  • 打赏
  • 举报
回复
看TWebResponse.Cookies,TWebRequest.CookieFields的help

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧