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.

Method of the class: Authentication{}

No Hooks.

Return

null. Nothing (null).

Usage

$Authentication = new Authentication();
$Authentication->set_logged_in_cookie( $logged_in_cookie );
$logged_in_cookie(string) (required)
The value for the logged in cookie.

Authentication::set_logged_in_cookie() code WC 8.7.0

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