【问题标题】:Only one session of same application, per user, at a time, in Intraweb在 Intraweb 中,每个用户一次只有一个相同应用程序的会话
【发布时间】:2013-10-07 15:21:28
【问题描述】:

我尝试围绕 Intraweb for Delphi 2010 进行调查。 我在 CRM 应用程序中有一个网页,每次用户翻转客户时,网页都会刷新。但是,“旧”页面的会话仍然处于活动状态,并且我得到“该版本仅限于 5 个活动会话”。 如何删除旧会话,当创建新会话时,它必须是相同的应用程序 ID,并且仅适用于当前用户。

【问题讨论】:

标签: delphi intraweb


【解决方案1】:

我最终得到了这个。 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;

【讨论】:

    猜你喜欢
    • 2015-03-12
    • 2012-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-02
    • 2023-03-28
    • 1970-01-01
    • 2014-07-03
    相关资源
    最近更新 更多