WordPress at Your Fingertips
function is not described

WC_Session_Handler::forget_session() public WC 1.0

Forget all session data without destroying it.

{} 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->forget_session();

Code of WC_Session_Handler::forget_session() WC 5.9.0

public function forget_session() {
	wc_setcookie( $this->_cookie, '', time() - YEAR_IN_SECONDS, $this->use_secure_cookie(), true );

	wc_empty_cart();

	$this->_data        = array();
	$this->_dirty       = false;
	$this->_customer_id = $this->generate_customer_id();
}