Automattic\WooCommerce\StoreApi

SessionHandler::init_session_from_token()protectedWC 1.0

Process the token header to load the correct session.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->init_session_from_token();

Код SessionHandler::init_session_from_token() WC 8.7.0

protected function init_session_from_token() {
	$payload = JsonWebToken::get_parts( $this->token )->payload;

	$this->_customer_id       = $payload->user_id;
	$this->session_expiration = $payload->exp;
	$this->_data              = (array) $this->get_session( $this->_customer_id, array() );
}