Automattic\WooCommerce\StoreApi

SessionHandler::save_data()publicWC 1.0

Save data and delete user session.

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

Хуков нет.

Возвращает

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

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

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

Код SessionHandler::save_data() WC 9.8.5

public function save_data() {
	// Dirty if something changed - prevents saving nothing new.
	if ( $this->_dirty ) {
		global $wpdb;

		$wpdb->query(
			$wpdb->prepare(
				"INSERT INTO $this->table (`session_key`, `session_value`, `session_expiry`) VALUES (%s, %s, %d) ON DUPLICATE KEY UPDATE `session_value` = VALUES(`session_value`), `session_expiry` = VALUES(`session_expiry`)", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				$this->_customer_id,
				maybe_serialize( $this->_data ),
				$this->session_expiration
			)
		);

		$this->_dirty = false;
	}
}