怎么获得cookie 值啊?还有 比如 我在 post 一个网页的时候,还有一些cookie怎么设置啊? 
 谢谢了, 最好能带一些带码 :)

解决方案 »

  1.   

    Indy Misc选项上有IdCookieManager控件用它和IdHttp组合来管理HTTP的Cookies
    用IdCookieManager1.AddCookie的方法就能添加Cookie
      

  2.   

    这个我知道的
     我想知道 比如 我 get 一个网址后 , 怎么获得 网址带下来的 cookie 的内容
      

  3.   

    明确告诉你..这不可能的..
    我以前也有这样的打算.想实现这样的功能..但delphi+indy..不可能.绝不可能.
      

  4.   

    HTTP.Get(cbURL.Text);
              for J := 0 to http.Response.ExtraHeaders.Count - 1 do
              begin
                if (UpperCase(Copy(http.Response.ExtraHeaders[J], 1, 10)) = 'SET-COOKIE') and (edt1.text = '') then
                begin
                  Cookie := Trim(Copy(http.Response.ExtraHeaders[J], 12, MAXINT));
                  Cookie := Copy(Cookie, 1, Pos(';', Cookie) - 1);
                  http.Request.Extraheaders.Add('Cookie: ' + Cookie);
                  edt1.text := 'Cookie: ' + Cookie;
                end;
              end;
      

  5.   

    使用idhttp里的cookiemanager ,在cookiemanager 的onNewCookie 事件里获得cookie。var 
      cookie :String;procedure TForm1.IdCookieManager1NewCookie(ASender: TObject;
      ACookie: TIdCookieRFC2109; var VAccept: Boolean);
    begin
      cookie:= Acookie.ClientCookie;
    end;