private function _session_read() { if (empty($this->_session)) { $config = get_config(); $session = filter_input(INPUT_COOKIE, $config['sess_cookie_name']); require_once BASEPATH . 'libraries/Encrypt.php'; $encrypt = new CI_Encrypt(); $this->_session = unserialize($encrypt->decode($session, $config['encryption_key'])); } return $this->_session; }
function decode($string, $key = "") { $string = strtr($string, array('.' => '+', '_' => '=', '~' => '/')); return parent::decode($string, $key); }