Automattic\WooCommerce\StoreApi\Routes\V1

AbstractCartRoute::get_cart_token_expiration()protectedWC 1.0

Gets the expiration of the cart token. Defaults to 48h.

Method of the class: AbstractCartRoute{}

Hooks from the method

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_cart_token_expiration();

AbstractCartRoute::get_cart_token_expiration() code WC 9.5.1

protected function get_cart_token_expiration() {
	/**
	 * Filters the session expiration.
	 *
	 * @since 8.7.0
	 *
	 * @param int $expiration Expiration in seconds.
	 */
	return time() + intval( apply_filters( 'wc_session_expiration', DAY_IN_SECONDS * 2 ) );
}