unigui监听会话开始和结束
unigui监听会话开始和结束
通过TUNIGuiSessionManger类的相关属性可以来监听web会话的开始与结束。
如:UniServerModule.SessionManager.Sessions.OnSessionStart := OnSessionStart;
UniServerModule.SessionManager.Sessions.OnSessionEnd := OnSessionEnd;
procedure TFrmMon.OnSessionStart(Sender: TIdHTTPSession); var RemoteIp,SessionID:string; begin RemoteIP:= TUniGUISession(Sender).UniApplication.RemoteAddress; SessionID:= TUniGUISession(Sender).SessionID; //根据ip和会话编号进一步处理。 end; procedure TFrmMon.OnSessionEnd(Sender: TIdHTTPSession); var RemoteIp,SessionID:string; begin RemoteIP:= TUniGUISession(Sender).UniApplication.RemoteAddress; SessionID:= TUniGUISession(Sender).SessionID; //根据ip和会话编号进一步处理。 end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/14736424.html