用IDHTTP登录某网站 返回下面源代码<script language=javascript src="js/Cookies.js"></script>
<SCRIPT language=JavaScript>SetCookie('imlmusername','330428',1);SetCookie('PASS','46498d669f7bf58073bbc649f15598c3',1);this.location.href='accounts.asp';</SCRIPT>GET其他页是没有登录状态下的
有人知道这个怎么搞么还有就是IDHTTP自定义COOKIE的方法 百度一大圈都不行

解决方案 »

  1.   

    sIdHTTP.CookieManager.CookieCollection.Clear;
    sIdHTTP.CookieManager.AddCookie(sCookList,sIdHTTP.Request.Host);
      

  2.   

    自定义包头,类似:
     IdHttp1.Request.SetHeaders;
      IdHttp1.Request.CustomHeaders.Text := 'Connection: keep-alive
    Content-Type: application/x-www-form-urlencoded
    Host: yxck.impc.com.cn
    Accept: text/html, */*
    User-Agent: Mozilla/3.0 (compatible; Indy Library)
    Cookie: imlmusername=330428;PASS=46498d669f7bf58073bbc649f15598c3';
      

  3.   

    IdHttp1.Request.SetHeaders;
    IdHttp1.Request.CustomHeaders.add('Cookie: mlmusername=330428;PASS=46498d669f7bf58073bbc649f15598c3');