I am developing an E-Commerce application. But the problem is when user adds a product to cart and close the browser before order, the cart takes all the products. All the cart items are saved in a table.
I just want to flush the cart if the user closes the browser without ordering.
You can use Javascript event to catch browser close and sent ajax request to some script that will delete cart data:
UPDATED