Well the good thing is that with CoCart you don’t have to if you are building with a JS framework or app for iOS or Android. The use of the CoCart cookie is general used for the WordPress site managing your WooCommerce store.
So if you are not able to read the cookies. Don’t worry, there are a couple of things you can do.
- Look for a cookie support add-on for your JS framework or app. React for example has one called react-cookies. That should help read cookies.
- We recommend instead that you read the cart key value in the returned header response
X-CoCart-API
. Once you have that value you can use it to set thecart_key
parameter on all API requests. However, this method is designed for guest customers only.
For a registered customer you would not need the use of cookies either as you will be authenticating the customer from when they logged in.
Was this helpful to you?
Did you like the article/guide or would you like to give some feedback? Click on one of the buttons and let us know your opinion!