Automattic\WooCommerce\StoreApi

SessionHandler::get_customer_unique_idpublicWC 1.0

Get session unique ID for requests if session is initialized or user ID if logged in.

Method of the class: SessionHandler{}

No Hooks.

Returns

String.

Usage

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

SessionHandler::get_customer_unique_id() code WC 10.7.0

public function get_customer_unique_id() {
	if ( $this->has_session() && $this->get_customer_id() ) {
		return $this->get_customer_id();
	}
	return is_user_logged_in() ? (string) get_current_user_id() : '';
}