在DELPHI里怎样使用cookies,多谢帮助,
解决方案 »
- 解释代码 关于TStream
- FastReport 怎么快速入门??原来用QR的,最简单的就好,怎么做?能几分钟内会吗?
- 新手一问,为何用在BDE administrator 中用windows帐户密码连接不了SQL SERVER?
- 在以前dos对扇区的读写很容易实现,在windows的环境下有什么相关的api函数?
- 怎样设置ComboBox为只读?
- 当ClientSocket1 连结并不存在的主机时程序并提示出错,我该如何扑捉?如成功与否我如何判断?
- 在Delphi6中有的label控件中如果输入过长的中文就不能显示完全 在线等
- 收集老板言语、行动
- 各位高手,有关windows的mediaplay播放问题,请求援助!!
- 我想学好delphi
- 怎样找游戏的句柄?比如星际争霸,CS之类的,这样的窗体没有标题栏
- 如何读本机的cookie?
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;
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';
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;