WC_Session::set()publicWC 1.0

Set a session variable.

Method of the class: WC_Session{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Session = new WC_Session();
$WC_Session->set( $key, $value );
$key(string) (required)
Key to set.
$value(mixed) (required)
Value to set.

WC_Session::set() code WC 8.7.0

public function set( $key, $value ) {
	if ( $value !== $this->get( $key ) ) {
		$this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value );
		$this->_dirty                        = true;
	}
}