Automattic\WooCommerce\StoreApi
SessionHandler::save_data
Save data and delete user session.
Method of the class: SessionHandler{}
No Hooks.
Returns
null. Nothing (null).
Usage
$SessionHandler = new SessionHandler(); $SessionHandler->save_data();
SessionHandler::save_data() SessionHandler::save data code WC 10.7.0
public function save_data() {
// Dirty if something changed - prevents saving nothing new.
if ( $this->_dirty ) {
global $wpdb;
$wpdb->query(
$wpdb->prepare(
'INSERT INTO %i (`session_key`, `session_value`, `session_expiry`) VALUES (%s, %s, %d) ON DUPLICATE KEY UPDATE `session_value` = VALUES(`session_value`), `session_expiry` = VALUES(`session_expiry`)',
$this->table,
$this->get_customer_id(),
maybe_serialize( $this->_data ),
$this->session_expiration
)
);
$this->_dirty = false;
}
}