hmmmmmmmmmmmmmm.... >:(
If one user can login in the same time twice, he can move around in the pages of my site, and some pages set their custom session variables (meaning my creation) and theese variables influences the behavior of other pages... so I dont want to mess everything up just because one user want to have fun....
So I did the following:
1. I wrote a plugin which updates the active_users table when a users log off.... and it replaces the action field with 8.
2. I verified directly in the weblogin.processor.inc.php, before the $modx->invokeEvent("OnBeforeWebLogin",...) command, if the action field for that username is different from 8, so that means that the login process must stop with a message of error....
I tried to write a plugin for step 2, but I don’t know how to access variables in weblogin.processor.inc.php, from the plugin, cause I wanted to influence form the plugin the route in the weblogin.processor.inc.php, but I failed:P...... so I aborted the idea of the plugin (maybe u can give me an idea...)
...BUT.....
if the user closes the window, or the client shuts down, or some failure appears, the active_users table is not updated, and when the user tries to log back, the server sees that the user is still logged in (because the value of action in the active_users table is, logically

, different from 8 ), and this is too much for me.... because I don’t know how to work with sessions, and I dont know where modx receives information that a session has ended when a user closes the window for example.
And... the perfect way it would be to give priority to the new login attempt, and the previous session of that user to disappear in space:P.... but How do I do that?
PS: I dont care about the method, not accepting a second login, login #2 as u say, or not accepting multiple logins from the same user.... the goal is for a user to log once, not multiple times.... so, ofcourse that what I really want is to not permit multiple logins...