Automattic\WooCommerce\StoreApi

Authentication::set_logged_in_cookie()publicWC 1.0

When the login cookies are set, they are not available until the next page reload. For the Store API, specifically for returning updated nonces, we need this to be available immediately.

{} Это метод класса: Authentication{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$Authentication = new Authentication();
$Authentication->set_logged_in_cookie( $logged_in_cookie );
$logged_in_cookie(строка) (обязательный)
The value for the logged in cookie.

Код Authentication::set_logged_in_cookie() WC 6.8.0

public function set_logged_in_cookie( $logged_in_cookie ) {
	if ( ! defined( 'LOGGED_IN_COOKIE' ) || ! $this->is_request_to_store_api() ) {
		return;
	}
	$_COOKIE[ LOGGED_IN_COOKIE ] = $logged_in_cookie;
}