2013-10-07 30 views
-1

我試圖圍繞Delphi 2010的Intraweb進行調查。 我在CRM應用程序中有一個網頁,並且每次用戶翻轉客戶時,網頁刷新。然而,「舊」頁面的會話保持活動,並且我得到「該版本僅限於5個活動會話」。 如何刪除舊會話,創建新會話時,它必須是相同的應用程序ID,並且只能用於當前用戶。每次用戶只有一次同一個應用程序在Intraweb

+0

也許這就是答案。我已經從中建立了解決方案,但我無法在8小時之前發佈答案。無論如何需要用多個用戶來測試它,但它應該工作。 https://forums.embarcadero.com/thread.jspa?messageID=525644 – user1611655

回答

0

我結束了這一點。 https://forums.embarcadero.com/thread.jspa?messageID=525644

procedure TIWServerController.IWServerControllerBaseNewSession 
    (ASession: TIWApplication; var VMainForm: TIWBaseForm); 
var 
    i:  integer; 
    List: TList; 
    App: TIWApplication; 
begin 
    List:=GSessions.LockList; 
    try 
     for i:=0 to List.Count - 1 do begin 
      App:=TIWApplication(List[i]); 
      if App <> ASession then begin 
       GSessions.Remove(App); 
       App.Free; 
      end; 
     end; 
    finally 
     GSessions.UnLockList; 
    end; 
    ASession.Data:=TIWUserSession.Create(nil); 
end; 
相關問題