当然可以,
看一下ISAPI的例子

解决方案 »

  1.   

    看TWebResponse.Cookies,TWebRequest.CookieFields的help
      

  2.   

    可以。
    根据网景关于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;