i actually faced same problem ….actually this problem is related to the theme cache or related to any other cache plugin…..but now i totally found the solution..
colpy these three line into yout .htaccess file on the root of the wordpress
RewriteRule ^wp-json – [E=NOCOOKIE:1]
SetEnvIf REDIRECT_NOCOOKIE 1 NOCOOKIE=1
Header always unset Set-Cookie env=NOCOOKIE
and also add this code into yours child themes function.php
add_action(‘woocommerce_before_checkout_form’, ‘dump_woocommerce_cart’);
function dump_woocommerce_cart() {
global $woocommerce;
//print_r($woocommerce->cart);
}
function d6_remove_persistent_cart($value, $id, $key) {
if ( $key == ‘_woocommerce_persistent_cart_1’) {
return false;
}
return $value;
}
add_filter(‘get_user_metadata’, ‘d6_remove_persistent_cart’, 10, 3);
add_filter(‘update_user_metadata’, ‘d6_remove_persistent_cart’, 10, 3);
add_filter(‘add_user_metadata’, ‘d6_remove_persistent_cart’, 10, 3);
this totally resolve my problem….
i hope it will help..thank you