ShoppingCartID same for different users?

Brandon Prudent asked on June 16, 2018 01:40

So for some reason ECommerceContext.CurrentShoppingCart is the same despite the session changing. A browser that has never visited already has items in the cart, and it just keeps giving the same cart to everyone. Has anyone seen that before? I feel like I'm going crazy. Any black magic I can do to prevent it?

Correct Answer

Brandon Prudent answered on June 19, 2018 20:31

Turns out we had basic authentication on, which gave everyone the same cart.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Richard Lloyd answered on July 26, 2018 09:55

Hi Brandon, we're getting the same issue. Where did you make the change to get around this? I'm new to Kentico and not familiar with where everything is configured. Can you list this so we have a complete answer to your question as i think others will run into this. Thanks, Richard

0 votesVote for this answer Mark as a Correct answer

Brandon Prudent answered on July 26, 2018 23:21

Hey there Richard - you would have had to have gone out of your way to enable Basic Authentication in IIS in the first place. Do you have to enter a un/pass to access the site? Kentico will assume you are logging in as that person then and give a recurring cart to them.

1 votesVote for this answer Mark as a Correct answer

Richard Lloyd answered on August 10, 2018 10:54

It turns out there is a session cookie set called CMSShoppingCart. If this exists then they have already added something to the cart. The value of this is the guid of the cart. It is best to use this to track the cart and match it to the user. You can check the cartid like this: ShoppingCartInfoProvider.GetShoppingCartInfo(cartId); This would appear to be the right approach for handling user carts.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.