WC_Session_Handler::delete_sessionpublicWC 1.0

Delete the session from the cache and database.

Method of the class: WC_Session_Handler{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Session_Handler = new WC_Session_Handler();
$WC_Session_Handler->delete_session( $customer_id );
$customer_id(string) (required)
Customer session ID.

WC_Session_Handler::delete_session() code WC 10.3.3

public function delete_session( $customer_id ) {
	if ( ! $customer_id ) {
		return;
	}
	$GLOBALS['wpdb']->delete( $this->_table, array( 'session_key' => $customer_id ) );
	wp_cache_delete( $this->get_cache_prefix() . $customer_id, WC_SESSION_CACHE_GROUP );
}