erich.wanker Posted July 30, 2014 Posted July 30, 2014 Hello, i try to log Session-ID and IP - but doesn´t work ? procedure TMainForm.UniFormCreate(Sender: TObject); begin UniServerModule.SessionManager.Sessions.GetSession(aktuell_session,aktuell_ip); aktuell_session:='[SessionID:'+aktuell_session+'] '; aktuell_ip:='[DeviceIP:'+aktuell_ip+'] '; UniServerModule.Logger.AddLog(aktuell_session+aktuell_ip+' -> starts'); any Ideas what´s wrong ? ThanX Quote
Semper Posted July 30, 2014 Posted July 30, 2014 Try modify this code var i : Integer; ASessionList: TList; ASession : TUniGUISession; s: string; iActiveSession: Integer; begin lstSessions.Clear; ASessionList:=UniServerModule.SessionManager.Sessions.SessionList.LockList; try for i := 0 to ASessionList.Count-1 do begin ASession := TUniGUISession(ASessionList); if not ASession.IsTerminated then begin s:=TUniGUISession(ASessionList).UniApplication.UniSession.SessionID+' ('+ TUniGUISession(ASessionList).UniApplication.RemoteAddress+ ', browser '+TUniGUISession(ASessionList).UniApplication.ClientInfoRec.BrowserType+ TUniGUISession(ASessionList).UniApplication.ClientInfoRec.BrowserVersion.ToString+')' ; if Pos(UniSession.SessionID,s)<>0 then begin s:='<b>'+s+' - Current session!</b>'; iActiveSession:=i; end; s:='<img src="images/domain_template.png" align="left"/> <p style="font-size:11px"/>'+s; lstSessions.Items.Add(s); end; end; lstSessions.ItemIndex:=iActiveSession; btnSessionClose.Enabled:=False; if lstSessions.Items.Count=1 then btnCloseAllSessions.Enabled:=False else btnCloseAllSessions.Enabled:=True; finally UniServerModule.SessionManager.Sessions.SessionList.UnlockList; end; This code from my project, untreated. So my apologies 1 Quote
erich.wanker Posted July 30, 2014 Author Posted July 30, 2014 i found a solution.. aktuell_session:=UniApplication.UniSession.SessionID; aktuell_ip:=UniApplication.RemoteAddress; aktuell_session:='[sessionID:'+aktuell_session+'] '; aktuell_ip:='[DeviceIP:'+aktuell_ip+'] '; if mainform.logger=true then UniServerModule.Logger.AddLog(mainform.aktuell_username,mainform.aktuell_session+mainform.aktuell_ip); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.