Automattic\WooCommerce\StoreApi

SessionHandler::save_datapublicWC 1.0

Save data and delete user session.

Метод класса: SessionHandler{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$SessionHandler = new SessionHandler();
$SessionHandler->save_data();

Код SessionHandler::save_data() WC 10.8.1

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;
	}
}