I am working on the Cakephp 3.
I need user only login once at time.
I am using Cakephp Auth component for the login into app. I worked with database session and cake session.
But when i am try to delete Session Manually from database or delete the session file form app/tmp/session, the session re-create again.
I don't want to disallow second login of user, but want to destroy previous session.
how can I achieve single session of user in Cakephp 3.
You can store the current session id of the user in the users table:
Before login, check if the current session id is present in the users table for that user.
If the session id is present, destroy the old session by deleting it from the sessions table.
After login, store the generated session id.