WC_Session::getpublicWC 1.0

Get a session variable.

Method of the class: WC_Session{}

No Hooks.

Returns

Mixed. value of session variable

Usage

$WC_Session = new WC_Session();
$WC_Session->get( $key, $default_value );
$key(string) (required)
Key to get.
$default_value(mixed)
used if the session variable isn't set.
Default: null

WC_Session::get() code WC 10.3.6

public function get( $key, $default_value = null ) {
	$key = sanitize_key( $key );
	return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default_value;
}