eriktobben
4 months ago

Best way of keeping Cart active after logout

Posted 4 months ago by eriktobben

Hi,

I am developing an eCommerce site and I have a question related to the cart. Currently I have a Cart model and a CartItem model where the cart and its content is stored. When a user adds a product to cart, I create the cart and store the cart ID in session.

My problem is when the user logs out the session is cleared and the user gets an empty cart because the cart ID in session is no longer there.

What is the best way to solve this issue?

Please sign in or create an account to participate in this conversation.