wp_set_auth_cookie causes 403 error in the wooCommerce checkout

wp_set_auth_cookie causes 403 error in the wooCommerce checkout