Hi @pujithamutyala
When the cookies are not sent, this means that it is a new session/user. Therefore new cart token must be generated. Is this not the correct behaviour?
Your understanding is correct. Typically, a new cart token should be generated for a new session or user when no cookies are sent. However, without cookies, the API might not be able to identify it as a new session and hence, may not generate a new token.
Also in what scenario is a new cart token created? Can you point out the source code in WooCommerce which generates the cart token?
A new cart token is usually created when a new cart is initiated, or an existing cart undergoes significant changes like adding or removing items.
The code can be can be found in the WC_Session_Handler
class in the class-wc-session-handler.php
file. The get_cart_cookie
function is responsible for generating the cart token.
If you still need further insights, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.
I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.