jmonty77 Posted December 18, 2019 Share Posted December 18, 2019 Hello, what is the proper way of closing a session? I've tried: SessionManager.Sessions.PurgeSessionById(SessionId) session.uniapplication.terminate(''); session.Terminate() All this functions works in my developer server, but I've a production server where some sessions cannot be closed. After calling this functions, I see that the mainmodule is not destroyed and if I list the sessions, I still can see that session: for I := 0 to self.SessionManager.Sessions.SessionList.Count - 1 do self.SessionManager.Sessions.SessionList; .... I'm using an old version of unigui (1.0.0.1410). May be is it solved in current version? Thank you Jordi Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted December 23, 2019 Administrators Share Posted December 23, 2019 Hi, First of all, why do you want to close a session manually? Quote Link to comment Share on other sites More sharing options...
jmonty77 Posted December 23, 2019 Author Share Posted December 23, 2019 In a local network, when I detect a new session with same IP of another one that already exists, i want to close this older one. I don't know from where came this older sessions, because my customer says that only one browser window is open at a time. And I see in logs that this sessions are not executing code anymore. They are listed, but cannot be freed. My server is in a local network where clients modify their IP periodically, if it helps. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted December 23, 2019 Administrators Share Posted December 23, 2019 You can set the SessionTimeout to 10 minutes (default) and idle sessions will go away automatically. Quote Link to comment Share on other sites More sharing options...
jmonty77 Posted December 23, 2019 Author Share Posted December 23, 2019 I've this configuration. But talking about killing a session manually, it can be done? What does "SessionManager.Sessions.PurgeSessionById(SessionId)"? I 've not found documentation, but this terminates a session when i try in my development server. What situation can make that after calling this function, sessionid is still listed in session list forever? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted December 23, 2019 Administrators Share Posted December 23, 2019 Please see our latest demos on this. You need to use the latest build. Quote Link to comment Share on other sites More sharing options...
jmonty77 Posted December 23, 2019 Author Share Posted December 23, 2019 I can only download trial version 1.90.0.1509. Is it ok? Which demo do you propose to learn? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted December 24, 2019 Administrators Share Posted December 24, 2019 "Session List" demo. 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.