Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

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

jneusteter
Shopify Partner
4 0 4

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 10 (10)

phester17
Shopify Partner
22 1 14

We are having the same issue. 

SBD_
Shopify Staff
1831 273 423

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 2

I'm also seeing this on live shops now.

phester17
Shopify Partner
22 1 14

Hi @SBD_ ,

 

I've had tickets open with Shopify Plus support about this since Jan 10th, but I haven't made much progress there and it's still an issue.

 

The duplicate cookie issue can be easily replicated by placing a few orders in a row.

 

I've also noticed the 400 "Cookie Too Large" error is easier to trigger when the products in the cart have longer titles, because the "checkout_session_token__cn__" cookies contain the product names.


Thanks for your help!

jneusteter
Shopify Partner
4 0 4

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 4

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

SBD_
Shopify Staff
1831 273 423

Thanks. Chasing up the checkout folks.

Scott | Developer Advocate @ Shopify 

dalicommerce
Visitor
1 0 0

Same issue here. Any updates to fix this? Shopify should delete the old cookies.

SBD_
Shopify Staff
1831 273 423

Hey everyone,

 

Just heard back - there's a team working on resolving this. Thanks for all the reports.

Scott | Developer Advocate @ Shopify 

ebbo_edrujo
Shopify Partner
1 0 0

Any news about this issue?