I'm building an E-commerce website on node.js in which I need to implement cart, wherein a user can add products to cart without loging in like amazon and when he signs in those products should automatically get added to the cart, At present I'm adding cart to the user session .Can anyone help me with the flow. var cart = []; function add_to_cart(req, res, next) { db.arts.findOne(query, function(err, art) { if (err) return next(err); if (!art) {...
Originally asked by learner on Stack Exchange (stackoverflow) (CC BY-SA 3.0).