PHPRunner’s Security API lets an administrator switch to another application user without knowing that user’s password. This is useful when an administrator needs to reproduce a problem using the same pages, permissions, and data access as the user.
In this tutorial we will add an impersonation button to the login table, switch accounts with Security::loginAs(), display a warning banner while impersonation is active, and provide a link that restores the original administrator session.
We will cover:
1. Preparing the login table and administrator group
2. Adding an impersonation button to the List page
3. Showing the button only to administrators
4. Switching to the selected user
5. Redirecting after impersonation
6. Adding an impersonation banner
7. Styling the banner
8. Returning to the administrator session





