Back to Factory class

Method getSession

public static \Joomla\CMS\Session\Session
getSession
(array $options = array())
Get a session object.
Parameters
  • array $options An array containing session options
Returns
  • \Joomla\CMS\Session\Session object
Since
  • 1.7.0
Deprecated
  • 5.0
-
  • \Joomla\CMS\Session\Session
Class: Factory
Project: Joomla

Method getSession - Source code

/**
 * Get a session object.
 *
 * Returns the global {@link Session} object, only creating it if it doesn't already exist.
 *
 * @param   array  $options  An array containing session options
 *
 * @return  Session object
 *
 * @see         Session
 * @since       1.7.0
 * @deprecated  5.0  Load the session service from the dependency injection container or via $app->getSession()
 */
public static function getSession(array $options = array())
{
    @trigger_error(sprintf('%1$s() is deprecated. Load the session from the dependency injection container or via %2$s::getApplication()->getSession().', __METHOD__, __CLASS__), E_USER_DEPRECATED);
    return self::getApplication()->getSession();
}