2010-12-18 74 views
1

登錄論壇後需要幫助保持會話。 我使用TIdHttp,並已經分配已經DELPHI/INDY/IdHTTP登錄invision電源板論壇?

Http.Get(Url); //..Used to get session Id that is then stored in FSessionID 

    Param := TStringList.Create; 
    Param.Add('act=Login'); 
    Param.Add('CODE=01'); 
    Param.Add('s='+FSessionID); 
    Param.Add('referer='''''); 
    Param.Add('CookieDate=1'); 
    Param.Add('UserName=MYUsername'); 
    Param.Add('PassWord=MyPassword'); 
    Http.Post(Url,Param); //..The was Login succesfull. Made sure by checking responce 
    Http.Get(Url); //..Now its not logged in. Why???? 
+0

您使用的是哪個版本的indy? – jachguate 2010-12-18 14:59:45

回答

0

它出現在你的帖子,你是作爲一個參數...這將使我認爲你需要提供會話提供會話cookie管理作爲Get中的一個參數。 (cookie不似乎使用。)

也許你包括會話作爲URL的一部分,如:

Http.Get(URL + '?s=' + fSessionID) 
1

確保SessionID的cookie不會被TIdCookieManager當它拒絕到達。 Indy的Cookie支持目前被破解,導致有效的Cookie有時會被忽略而不是存儲。