On a clean install of WordPress, with Twenty Twenty One theme active and WooCommerce as the only installed plugin, I am seeing the $_COOKIE contents every time I update order status. So I can’t recreate the issue under these conditions. I hope that helps you at least by adding another data point in your investigation.
add_action('woocommerce_order_status_changed', 'wpsf_woocommerce_order_status_changed', 10, 3);
function wpsf_woocommerce_order_status_changed($id, $previous_status, $next_status)
{
error_log(print_r($id, true));
error_log(print_r($previous_status, true));
error_log(print_r($next_status, true));
error_log(print_r($_COOKIE, true));
}
Hi @affiliatenetworks,
If there’s a cache server or CDN involved, it may be filtering cookies based on a whitelist. This is to improve caching since each request with a unique set of cookies would need to be different from other requests and could not be cached (you may receive a different reply from the server based on your cookies, so the cache server cannot serve you the cached response of a previous client). Since lots of services are setting cookies that may be sent to the server (e.g. analytics packages) but do not influence the contents of the response, heeding all cookies by default would often completely subvert caching.
Configure the caching server in charge to pay attention to your cookie and to forward it to the origin server. If you have a lot of different cookies, consider giving them a common prefix and whitelist that (e.g. foo-*).
Hope this helps :)!
Let me know if my answer can help you resolve your issue!
Hi
Thank you so much for your helps, it turns out you are write and there is nothing wrong with my plugin.