如何用 TIdHTTP 取得 Session 的資訊 |
尚未結案
|
zaguan
一般會員 發表:11 回覆:18 積分:10 註冊:2002-03-31 發送簡訊給我 |
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
TIdHTTPDefaultSessionList.GetSession Retrieves a persistent HTTP session having the specified ID and remote IP address. function GetSession(const SessionID: string; const RemoteIP: string): TIdHTTPSession; override; Parameters const SessionID: string Session identifier to be located. const RemoteIP: string Optional remote IP address for the session. Returns TIdHTTPSession - Persisten session retrieved from the container. Description GetSession is a TIdHTTPSession function used to retrive a persistent HTTP session having the remote IP address and session identifier specified in SessionID and RemoteIP. GetSession insures that the internal thread list is locked prior to accessing sessions in the container.
GetSession will iteratively search through all sessions in the container until a session is located with the specified SessionID and RemoteIP. If RemoteIP contains an empty string, the first session with the same session identifier is used. When a session is located for the session identifer and remote IP address, the session is timestamped for last access to prevent purging as a stale session.
The return value for GetSession can contain Nil when a session cannot be located with the specified values.
GetSession will unlock the internal thread list prior to exiting from the method. 因為你!再大的難題,更顯得容易!
|
zaguan
一般會員 發表:11 回覆:18 積分:10 註冊:2002-03-31 發送簡訊給我 |
|
zaguan
一般會員 發表:11 回覆:18 積分:10 註冊:2002-03-31 發送簡訊給我 |
引言: TIdHTTPDefaultSessionList.GetSession 好像是Server端用的耶! 我想要從Client端獲取Session資訊,有辦法嗎? (抱歉,我對於Session的觀念可能不是很清楚,請不吝賜教!)在我詢問過高手的意見後,發現這件事是不可能的! 不過可以透過 CookieManager 取得 ServerCookie 以及 ClientCookie! 如果Server採用的是Session的方式! 我們頂多只能在CookieManager中,得到加密過後的SessionID! 以上是我的心得,如有錯誤,請指正! |
Ktop_Robot
站務副站長 發表:0 回覆:3511 積分:0 註冊:2007-04-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |