Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Issue With Excessive Cookies Leading To "Cookie Too Large" Error On Shopify Storefront API

jneusteter
Shopify Partner
4 0 3

We have noticed that for each purchase made through our store, Shopify appends a "checkout_session_token__cn__*" cookie.  The accumulation of these cookies eventually leads to a "Cookie Too Large" error. We can clear the cookies, but it just starts again until the error happens again.

 

It looks like the "checkout_session_token__cn__" cookies contain the history of purchases by that user. Even purchases that have been fully checked out.

 

We are using the Storefront API with the checkout url provided by the API.

 

I am hoping someone can point in the right direction on how to resolve this.

Replies 6 (6)

phester17
Shopify Partner
20 1 6

We are having the same issue. 

SBD_
Shopify Staff
1779 263 383

Hey @jneusteter 

 

Thanks for flagging this - running it by the Checkout team and will report back.

Scott | Developer Advocate @ Shopify 

thomaskenne
Shopify Partner
2 0 1

I'm also seeing this on live shops now.

jneusteter
Shopify Partner
4 0 3

Possible fix:

monorail-edge.shopifysvc.com might be blocked by your network.

 

After unblocking this endpoint it seems the cookies behave differently, so far this is working after about a week of no issues. For us this would happen at least a few times a week.

 

There is more here about that url: https://shopify.dev/docs/custom-storefronts/hydrogen/analytics

jneusteter
Shopify Partner
4 0 3

FYI, this ended up not solving the issue. We are still getting the error.

SBD_
Shopify Staff
1779 263 383

Thanks. Chasing up the checkout folks.

Scott | Developer Advocate @ Shopify