Back to WebApplication class

Method afterSessionStart

public void
afterSessionStart
(\Joomla\Session\SessionEvent $event)
After the session has been started we need to populate it with some default values.
Parameters
  • \Joomla\Session\SessionEvent $event Session event being triggered
Returns
  • void
Since
  • 3.0.1

Method afterSessionStart - Source code

/**
 * After the session has been started we need to populate it with some default values.
 *
 * @param   SessionEvent  $event  Session event being triggered
 *
 * @return  void
 *
 * @since   3.0.1
 */
public function afterSessionStart(SessionEvent $event)
{
    $session = $event->getSession();
    if ($session->isNew()) {
        $session->set('registry', new Registry());
        $session->set('user', new User());
    }
    // Ensure the identity is loaded
    if (!$this->getIdentity()) {
        $this->loadIdentity($session->get('user'));
    }
}