Automattic\WooCommerce\StoreApi

SessionHandler::init_session_from_token()protectedWC 1.0

Process the token header to load the correct session.

Method of the class: SessionHandler{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->init_session_from_token();

SessionHandler::init_session_from_token() code WC 9.3.1

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