/** * @attempt to get IP address of current visitor from server * @access public * @return string */ private function _save_session_to_db() { do_action('AHEE_log', __FILE__, __FUNCTION__, ''); if (!EE_Registry::instance()->REQ instanceof EE_Request_Handler || !(EE_Registry::instance()->REQ->is_espresso_page() || EE_Registry::instance()->REQ->front_ajax)) { return FALSE; } // first serialize all of our session data $session_data = serialize($this->_session_data); // encrypt it if we are using encryption $session_data = $this->_use_encryption ? $this->encryption->encrypt($session_data) : $session_data; // we're using the Transient API for storing session data, cuz it's so damn simple -> set_transient( transient ID, data, expiry ) return set_transient('ee_ssn_' . $this->_sid, $session_data, $this->_lifespan) ? TRUE : FALSE; }
/** * _save_session_to_db * * @access public * @return string */ private function _save_session_to_db() { if (!EE_Registry::instance()->REQ instanceof EE_Request_Handler || !(EE_Registry::instance()->REQ->is_espresso_page() || EE_Registry::instance()->REQ->front_ajax)) { return FALSE; } // first serialize all of our session data $session_data = serialize($this->_session_data); // encrypt it if we are using encryption $session_data = $this->_use_encryption ? $this->encryption->encrypt($session_data) : $session_data; // maybe save hash check if (apply_filters('FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG)) { set_transient(EE_Session::hash_check_prefix . $this->_sid, md5($session_data), $this->_lifespan); } // we're using the Transient API for storing session data, cuz it's so damn simple -> set_transient( transient ID, data, expiry ) return set_transient(EE_Session::session_id_prefix . $this->_sid, $session_data, $this->_lifespan); }