This topic is locked
[SOLVED]

 Count of open sessions.

1/25/2018 1:43:03 PM
PHPRunner General questions
D
DealerModules authorDevClub member

Hello,
Using:

PHPRunner 9.8 (build 29967)

Windows 10 PRO

Apache with MySQL 5.7
Background:

In an attempt to locking down an application, I first tried using a limit on the amount of users created. For example, I wanted no more that 20 users. (I am charging for a SAAS app.) But soon realized that users were sharing their logins to get around the limit to access the app.
Question:

Has anyone limited the users logged into an app based on open sessions? If so, can you point me into the right direction. I am thinking a count of sessions after successful login, that would either allow login or popup a dialogue warning stating "Sorry session limit of ## has been reached. Please try again later or contact us to increase available sessions".
Any direction appreciated.
Thanks
Paul

HJB 1/25/2018

PHP custom session handlers
... that's what you are looking for while there are numerous solutions seen on the web.

D
DealerModules authorDevClub member 1/25/2018



PHP custom session handlers
... that's what you are looking for while there are numerous solutions seen on the web.


Thank you! Will review.

HJB 1/25/2018
D
DealerModules authorDevClub member 1/25/2018



https://xlinesoft.com/blog/2015/04/21/displaying-a-list-of-users-that-are-currently-logged-in/


Thanks Sergey! I think this method will work perfectly for what I am trying to achieve!

mbintex 1/27/2018

I think the biggest problem with all these trials to control double logins with the same credentials used by different users is, that probably most users don´t logout correctly. Either they forget it, just shut down the computer, close the tab or window or the browser, or they have a crash of the browser, the computer or whatever.
Therefor you will have to free somehow the login - even if there is no logout - after a certain time. I doubt that any user will accept something like an hour or half an hour, if he had a crash or something before he can login again. So you will have to decrease the waiting time for a second login, but if it is only 10 or 5 minutes, it doesn´t really do anything in regards to controlling the number of open sessions, does it? Users will learn, that the second user of the database will have to wait x minutes, before he can login too. At least if they really want to save the money for a second user and don´t care for user rights management.