WordPress at Your Fingertips
function is not described

WC_Session::set() public WC 1.0

Set a session variable.

{} It's a method of the class: WC_Session{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of WC_Session::set() WC 5.5.2

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