/** * * Post-construction tasks to complete object construction. * * @return void * */ protected function _postConstruct() { parent::_postConstruct(); // only set up the handler if it doesn't exist yet. if (!self::$_handler) { self::$_handler = Solar::dependency('Solar_Session_Handler', $this->_config['handler']); } // only set up the request if it doesn't exist yet. if (!self::$_request) { self::$_request = Solar_Registry::get('request'); } // determine the storage segment; use trim() and strict-equals to // allow for string zero segment names. $this->_class = trim($this->_config['class']); if ($this->_class === '') { $this->_class = 'Solar'; } // set the class $this->setClass($this->_class); // lazy-start any existing session $this->lazyStart(); }
/** * * Post-construction tasks to complete object construction. * * @return void * */ protected function _postConstruct() { parent::_postConstruct(); // only set up the handler if it doesn't exist yet. if (!self::$_handler) { self::$_handler = Solar::dependency('Solar_Session_Handler', $this->_config['handler']); } // only set up the request if it doesn't exist yet. if (!self::$_request) { self::$_request = Solar_Registry::get('request'); } // determine the storage segment; use trim() and strict-equals to // allow for string zero segment names. $this->_class = trim($this->_config['class']); if ($this->_class === '') { $this->_class = 'Solar'; } // set the class $this->setClass($this->_class); // lazy start: find the cookie name and look for the session cookie $name = session_name(); if (self::$_request->cookie($name)) { // a previous session exists, start it $this->start(); } }