All, I have a simple plugin which does fire on login. I have the same plugin working in 2.5 but in my joomla 3.5 I cannot get it work get the username. This does work on Joomla 2.5

Here it is. Any help is greatly appreciated.

defined('_JEXEC') or die;
class PlgUserAddInfo extends JPlugin
    public function onUserLogin($user, $options = array())
        $user = JFactory::getUser();
        $mysignum = $user->username;
        $session = JFactory::getSession();
        $session->set('mysignum', $mysignum);

2 Answers 2


I think you need to use the onUserAfterLogin method instead: https://docs.joomla.org/Plugin/Events/User#onUserAfterLogin


In joomla 2.5 function onUserLogin() is used for your purpose. But in our joomla version 3.5 we use function onUserAfterLogin() is using.

You will also follow the link https://docs.joomla.org/Plugin/Events/User#onUserAfterLogin for more reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.