Depending on what you're trying to do, you may be able to just use a plugin connected to one of the Login events.
OnBeforeWebLogin fires before the authentication of the user.
OnWebAuthentication fires after the user has been authenticated, but before the check for access to any front-end context.
OnWebLogin fires after the user has been found to be authorized for the web context (or other front-end context).
If you hack the code, your work will be lost every time you upgrade MODX. Using a plugin would avoid that.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html