jahlxx Posted February 27, 2018 Share Posted February 27, 2018 Hi. Based in session list demo, I'm trying to build a query form for system administrator, to kow how many sessions are "live". The problem is to know who are connected. I have a login form, that validates username and password to login the app. Validation is against a database. Is there any property in unisession to store the username when user logs in? Unisession give info about active sessions, but could be useful to know who is the user for every session. I think that when a user log in the app, could be something in the unisession object to store the username. For example: if uservalid(xxxxxxxxxxxx) then unisession.someprop := username.text; Is this possible? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2018 Share Posted February 27, 2018 HI, If I understand you correctly, you can use like this: type TUniMainModule = class(TUniGUIMainModule) private { Private declarations } public { Public declarations } FMyStringVar : string; //<----- end; ... for I := 0 to S.SessionList.Count - 1 do begin U := S.SessionList[I]; ASessionList[I].ASessionId := U.SessionId; ASessionList[I].AIP := U.RemoteIP; ASessionList[I].ALastTime := U.LastTimeStamp; if U.UniMainModule <> nil then // Check mainModule availability. Some sessions may not have a MainModule instance ASessionList[I].AMyVar := (U.UniMainModule as TUniMainModule).FMyStringVar; // Access custom MainModule props //<------- end; ... Quote Link to comment Share on other sites More sharing options...
jahlxx Posted February 27, 2018 Author Share Posted February 27, 2018 great !!!! Thanks. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted February 27, 2018 Author Share Posted February 27, 2018 And, is possible to kill a session? Thanks. Quote Link to comment Share on other sites More sharing options...
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.