Back to JoomlaStorage class

Method __construct

public
__construct
(\Joomla\Input\Input $input, \SessionHandlerInterface $handler = null, array $options = [])
Constructor
Parameters
  • \Joomla\Input\Input $input Input object
  • \SessionHandlerInterface $handler Session save handler
  • array $options Session options
Since
  • 4.0.0
Class: JoomlaStorage
Project: Joomla

Method __construct - Source code

/**
 * Constructor
 *
 * @param   Input                     $input    Input object
 * @param   \SessionHandlerInterface  $handler  Session save handler
 * @param   array                     $options  Session options
 *
 * @since   4.0.0
 */
public function __construct(Input $input, \SessionHandlerInterface $handler = null, array $options = [])
{
    // Disable transparent sid support and default use cookies
    $options += ['use_cookies' => 1, 'use_trans_sid' => 0];
    if (!headers_sent() && !$this->isActive()) {
        session_cache_limiter('none');
    }
    $this->setOptions($options);
    $this->setHandler($handler);
    $this->setCookieParams();
    $this->data = new Registry();
    $this->input = $input;
    // Register our function as shutdown method, so we can manipulate it
    register_shutdown_function([$this, 'close']);
}