Reputation: 151
I need to find a way to destroy another user session for my login module. What I want is prevent multiple login's with the same credentials. Any idea?
Thanks in advance.
Upvotes: 1
Views: 531
Reputation: 26
Zend_Session::setId($sess_id);
Zend_Auth::getInstance()->clearIdentity();
Zend_Session::destroy();
where $sess_id is session id of that user.
Upvotes: 0
Reputation: 70933
You should write the session id used when logging in into your database.
Afterwards, when checking whether or not the credentials are valid for a request, check for the saved session id also. If it is not matching, the user is not logged in anymore with this session, e.g. he or someone else did another login with a different session id.
Upvotes: 1