/** * @param array $config */ public function __construct(array $config = []) { // make sure we've got all config elements for this driver $config['cookie'] = array_merge($this->defaults, isset($config['cookie']) ? $config['cookie'] : array()); // call the parent to process the global config parent::__construct($config); // store the defined name if (isset($config['cookie']['cookie_name'])) { $this->name = $config['cookie']['cookie_name']; } }
/** * @param array $config */ public function __construct(array $config = []) { // make sure we've got all config elements for this driver $config['file'] = array_merge($this->defaults, isset($config['file']) ? $config['file'] : []); // validate the path if (!($path = realpath($config['file']['path']))) { throw new \Exception('Configured session storage directory\\ "' . $this->config['file']['path'] . " is not accessable."); } $config['file']['path'] = $path . DIRECTORY_SEPARATOR; // call the parent to process the global config parent::__construct($config); // store the defined name if (isset($config['file']['cookie_name'])) { $this->name = $config['file']['cookie_name']; } }
/** * Set the global name of this session */ public function setName($name) { session_name($name); return parent::setName($name); }