WordPress at Your Fingertips
function is not described

WC_Session_Handler::init() public WC 3.3.0

Init hooks and session data.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Session_Handler = new WC_Session_Handler();
$WC_Session_Handler->init();

Changelog

Since 3.3.0 Introduced.

Code of WC_Session_Handler::init() WC 5.9.0

public function init() {
	$this->init_session_cookie();

	add_action( 'woocommerce_set_cart_cookies', array( $this, 'set_customer_session_cookie' ), 10 );
	add_action( 'shutdown', array( $this, 'save_data' ), 20 );
	add_action( 'wp_logout', array( $this, 'destroy_session' ) );

	if ( ! is_user_logged_in() ) {
		add_filter( 'nonce_user_logged_out', array( $this, 'maybe_update_nonce_user_logged_out' ), 10, 2 );
	}
}