I want to create multiple logins at a time on the same browser, like admin and user.
For that we are using different models like LoginForm.php and Adminlogin.php and different identity classes, i.e. User.php and Admin.php. But when we login with admin and at that time we want to login as a user admin gets logout and user gets login.
But I want to login both admin and user at same time. How to do that?
This is happening because, when a user is logged in by any role say admin, than internally like
when you logged in again with a diff user then the value in
$_SESSION['user_id']
is overrides by the new logged in user.So with this approach you cannot make this happen.
The best way to achieve this is to provide a role change functionality after logged in.