I am creating shopping cart application.
see below method that accept product id and add to linkedhashset. this is fine with single user but when second use is logged in and add something in cart then cart become same for both user.
Request 1 : Add to cart Mouse
Request 2 : Add to cart Monitor
when both user click on view cart then output will be Mouse and monitor both.
Please suggest how can i make separate cart for each user.