donlego Posted July 30, 2019 Share Posted July 30, 2019 hello i have unigui app with limiting the concurent login /access, when user session reached max limit my app will reject the login when use traditional unigui , it can handle when web server/server restart, then session list is become empty now i use hyper server unigui ver 1506, and store the user session on database, user on close browser tab/close the browser delete the session store in database, but sometime (i dont know why there still session list left /undeleted) my question is 1.why there sometime still session on the database left, i use delete session on database with this event TUniMainModule.UniGUIMainModuleBrowserClose TUniMainModule.UniGUIMainModuleDestroy On Logout menu(user click the logout) my delete function q.SQL.Text := 'DELETE FROM PENGGUNA_SESSION WHERE ID_SESSION=' + QuotedStr(ID_SESSION) + ''; 2. what best method to clear database session when web server restart/server restart 3.what best method can i use to clear left session every 5 minutes with session log time - current_time >5 hours, try use unithreadtimer on server module but no luck , it's never triger my function to clear database session Quote Link to comment Share on other sites More sharing options...
Wilton Ergon Posted July 30, 2019 Share Posted July 30, 2019 because you do not clear database sessions when your unigui server starts, so if you drop your server, starting will clear all pending connections. Quote Link to comment Share on other sites More sharing options...
donlego Posted July 30, 2019 Author Share Posted July 30, 2019 8 minutes ago, wilton_rad said: because you do not clear database sessions when your unigui server starts, so if you drop your server, starting will clear all pending connections. Which event on unigui , for trigering server start /unigui start Quote Link to comment Share on other sites More sharing options...
Ron Posted August 1, 2019 Share Posted August 1, 2019 On 7/30/2019 at 1:56 PM, donlego said: Which event on unigui , for trigering server start /unigui start In the UniServerModule.Create event you can clear all active sessions in the db. Quote Link to comment Share on other sites More sharing options...
Wilton Ergon Posted August 1, 2019 Share Posted August 1, 2019 remember to create a unique database connection for this, Quote Link to comment Share on other sites More sharing options...
donlego Posted August 5, 2019 Author Share Posted August 5, 2019 can't do this , coz i should not clear all session with user still connected to the system Quote Link to comment Share on other sites More sharing options...
donlego Posted August 5, 2019 Author Share Posted August 5, 2019 On 8/2/2019 at 12:37 AM, Ron said: In the UniServerModule.Create event you can clear all active sessions in the db. can't do this , coz i should not clear all session with user still connected to the system, need to count active session/user logged & active Quote Link to comment Share on other sites More sharing options...
rasaliad Posted August 5, 2019 Share Posted August 5, 2019 46 minutes ago, donlego said: can't do this , coz i should not clear all session with user still connected to the system, need to count active session/user logged & active But, when ServerModule Create, there is not user connected, or I'm wrong? Quote Link to comment Share on other sites More sharing options...
picyka Posted August 5, 2019 Share Posted August 5, 2019 When you create ServerModule you have no one connected to the system, as there is only one ServerModule instantiated, so when creating you can clear this table without problems. Quote Link to comment Share on other sites More sharing options...
picyka Posted August 5, 2019 Share Posted August 5, 2019 ServerModule unique in application MainModule each logged in user has their own. Quote Link to comment Share on other sites More sharing options...
donlego Posted August 6, 2019 Author Share Posted August 6, 2019 12 hours ago, picyka said: When you create ServerModule you have no one connected to the system, as there is only one ServerModule instantiated, so when creating you can clear this table without problems. thanks ron & picyka , it work i used on the server module on create to clear all left session , but not in the hyperserver mode , coz with hyperserver , every user opened the url/app it trigering the oncreate servermodule which delete all active session Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted August 6, 2019 Share Posted August 6, 2019 I also need this, since it's been a long time since I've been asking for this and nobody answers. Unfortunately... Quote Link to comment Share on other sites More sharing options...
donlego Posted August 6, 2019 Author Share Posted August 6, 2019 21 minutes ago, eduardosuruagy said: I also need this, since it's been a long time since I've been asking for this and nobody answers. Unfortunately... Yap request on first hyper server release, and i can't create cloud sas with many user/company without session list Quote Link to comment Share on other sites More sharing options...
shawdown Posted August 8, 2019 Share Posted August 8, 2019 I need that too. Quote Link to comment Share on other sites More sharing options...
Ron Posted August 13, 2019 Share Posted August 13, 2019 OK, I realize it could be a problem with the hyperserver, as new servermodules might be created at new client connections. Then you need to clear the sessions list when you start or restart the hyperserver, i.e. the IIS or Apache which runs the hyperserver. I use a script which triggers a webserver restart each night at 2AM, and this also restarts the dbserver. In such a script you could clear the db sessions table before starting the webserver. But having the option of triggering an event at hyperserver first init would be nice, as requested. Quote Link to comment Share on other sites More sharing options...
donlego Posted September 12, 2019 Author Share Posted September 12, 2019 database log node session id with node id 4_ still conected , the user has close the browser, unigui monitor node no 4 is none/not exist session on the node no 4 1 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.