All things Shopify and commerce
Hi Shopify Community,
I’ve come across an issue with the cart functionality on my Shopify store, and I wanted to share it here to see if others have experienced the same or if there’s a possible solution.
Issue Description:
When a user logs in to their account and adds items to their cart, the cart seems to be stored locally using browser cookies instead of syncing with the user’s account. If the user logs out without completing the checkout process and another user logs in on the same device, the second user can see the cart items left by the first user.
Steps to Reproduce (You can use the default Dawn theme website)
Step-1: Log in as User A on the Shopify store.
Step-2: Add items to the cart.
Step-3: Log out without checking out.
Step-4: Log in as User B on the same browser/device.
Step-5: Notice that User B sees the same cart items added by User A.
Why This is a Problem: -
1. Privacy Concern: Cart information from one user is visible to another, which could expose sensitive or personal choices.
2. User Experience Issue: The cart is not properly linked to individual accounts, leading to confusion for logged-in users.
Expected Behavior: The cart should be tied to the logged-in user’s account. When a user logs out, the cart should either: -
Be cleared for the next session,
OR Be saved to the logged-out user’s account, ensuring no overlap with another user’s cart.
Observations:
This issue is consistent across multiple Shopify websites I’ve tested, which suggests that this may be a platform-wide behavior.
Questions for the Community:
1. Has anyone else encountered this issue?
2. Is this the intended behavior, or is there a workaround to ensure carts are synced with user accounts rather than browser cookies?
1. Is there a setting or app that can help resolve this issue?
I believe this could be an important issue to address for privacy and user experience reasons. I’d love to hear your thoughts and any possible solutions!
Hi @dushyantCodiant 👋 it's expected behavior as otherwise you get an issue your steps miss:
Step-3: Log out without checking out.
Step-3a: User A still has their cart , instead of creating two carts that will make for ALOT of confusion.
And that's just the most obvious use case cart clearing would add bugs too.
If you want some sort of strict cart clearing you'll have to run your own javascript to do so, and or make the storefront require customer accounts.
Also see the new https://community.shopify.dev forums to pursue deeper issues there as these forums by volume RARELY get responses from shopify-staff about any type of internal insight for deeper behaviors like this.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025