OnManagerLogin
Last updated Oct 14th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn moreEvent: OnManagerLogin¶
Fires after a user logs into the manager, once the authentication checks have passed. The event does not affect the authentication process.
- Service: 2 - Manager Access Events
- Group: Security
Event Parameters¶
| Name | Description |
|---|---|
| user | The modUser that just logged in. |
| attributes | An array with: |
| - rememberme — whether the user asked to remember the login | |
| - lifetime — session cookie lifetime for this login | |
| - loginContext — context key for this login | |
| - addContexts — extra contexts that also received a session |
Event Login Workflow¶
- OnBeforeWebLogin || OnBeforeManagerLogin — a non-
trueoutput aborts the login with that message. - OnUserNotFound — runs only when the username is missing from the MODX database. A Plugin may supply its own
modUserto continue. - OnWebAuthentication || OnManagerAuthentication — overrides the default password check. A
trueoutput marks the user as verified and logged in. - OnWebLogin || OnManagerLogin — fires after the login has finished. It does not change the login outcome.
Example¶
Log who logged in and with which attributes:
<?php
$eventName = $modx->event->name;
switch($eventName) {
case 'OnManagerLogin':
$id = $user->get('id');
$modx->log(modX::LOG_LEVEL_ERROR, 'User logged in with id '.$id.' '.print_r($attributes, true));
break;
}
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn more










