WooCommerce::initialize_session()publicWC 3.6.4

Initialize the session class.

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

Hooks from the method

Return

null. Nothing.

Usage

$WooCommerce = new WooCommerce();
$WooCommerce->initialize_session();

Changelog

Since 3.6.4 Introduced.

Code of WooCommerce::initialize_session() WC 6.5.1

public function initialize_session() {
	// Session class, handles session data for users - can be overwritten if custom handler is needed.
	$session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
	if ( is_null( $this->session ) || ! $this->session instanceof $session_class ) {
		$this->session = new $session_class();
		$this->session->init();
	}
}