Our application uses Symfony 2.0 and MongoDB with FOSUserBundle to manage users.
The client wants to prevent the simultaneous use of the username from another device in their application.
Our idea is to cancel / delete all other sessions for the same user upon successful login.
The problem is that we cannot save the session to the database because the Mongo Session handler was added later in version 2.1.
The only solution we offer is to iterate over the session files stored in the file system and check if the username is stored in this file. If this is true, we simply delete the file and the login session to other places ends. Of course, we must verify that we are not deleting the current session either.
Does anyone have a better idea of ββhow the problem can be solved? If not, are there hidden traps we should be aware of?
mongodb symfony fosuserbundle
matejv
source share