Automattic\WooCommerce\Internal\StockNotifications\Frontend

NotificationManagementService::ensure_notice_sessionprivateWC 1.0

Ensure there is a cookie-based session so frontend notices survive the redirect.

Method of the class: NotificationManagementService{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->ensure_notice_session(): void;

NotificationManagementService::ensure_notice_session() code WC 10.9.4

private function ensure_notice_session(): void {
	if ( WC()->session instanceof \WC_Session_Handler && ! WC()->session->has_session() ) {
		WC()->session->set_customer_session_cookie( true );
	}
}