What to do if I cant use Cookies?

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.

  1. 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.
  2. 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 the cart_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?