public function decode($string, $key = '') { if (preg_match('/[^a-zA-Z0-9\\/\\+=]/', $string) or base64_encode(base64_decode($string)) !== $string) { return FALSE; } return $this->mcrypt_decode(base64_decode($string), $this->get_key($key)); }
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; }