Cake\Network\Session::__construct PHP Метод

__construct() публичный Метод

### Configuration: - timeout: The time in minutes the session should be valid for. - cookiePath: The url path for which session cookie is set. Maps to the session.cookie_path php.ini config. Defaults to base path of app. - ini: A list of php.ini directives to change before the session start. - handler: An array containing at least the class key. To be used as the session engine for persisting data. The rest of the keys in the array will be passed as the configuration array for the engine. You can set the class key to an already instantiated session handler object.
public __construct ( array $config = [] )
$config array The Configuration to apply to this session object
    public function __construct(array $config = [])
    {
        if (isset($config['timeout'])) {
            $config['ini']['session.gc_maxlifetime'] = 60 * $config['timeout'];
        }
        if (!empty($config['cookie'])) {
            $config['ini']['session.name'] = $config['cookie'];
        }
        if (!isset($config['ini']['session.cookie_path'])) {
            $cookiePath = empty($config['cookiePath']) ? '/' : $config['cookiePath'];
            $config['ini']['session.cookie_path'] = $cookiePath;
        }
        if (!empty($config['ini']) && is_array($config['ini'])) {
            $this->options($config['ini']);
        }
        if (!empty($config['handler']['engine'])) {
            $class = $config['handler']['engine'];
            unset($config['handler']['engine']);
            session_set_save_handler($this->engine($class, $config['handler']), false);
        }
        $this->_lifetime = ini_get('session.gc_maxlifetime');
        $this->_isCLI = PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg';
        session_register_shutdown();
    }