WC_Session_Handler::forget_session
Forget all session data without destroying it.
Метод класса: WC_Session_Handler{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Session_Handler = new WC_Session_Handler(); $WC_Session_Handler->forget_session();
Код WC_Session_Handler::forget_session() WC Session Handler::forget session WC 11.2.2
public function forget_session() {
wc_setcookie( $this->_cookie, '', time() - YEAR_IN_SECONDS, $this->use_secure_cookie(), true );
if ( ! is_admin() ) {
include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
wc_empty_cart();
}
$this->_data = array();
$this->_dirty = false;
$this->_customer_id = $this->generate_customer_id();
$this->_has_cookie = false;
}