Undefined on login usually is related to trying to logout from an account and logging with with a different account while you have some caching plugin on. That cache plugin keeps in cache the previous login and never lets you logout completely. When trying to login with a different account – it will give this error because although logout, in cache you’re still logged in with the previous account.
a. delete cache from the plugin. try then to login again
b. use a cache plugin that deletes cache regularly (like every 15 minutes) and automatically so this does not happen.