Hi Nico,
1. I am sure you will have a submit button for purchasing an item. If the user clicks on it, you are going to retrieve the item's info (say item id) and store it in a
String or Java Bean, say, and add it to the LinkedList. (This List will be present in the HttpSession object corresponding to this user. This Session will be the common share area where you can store the List.)
2. When the user clicks on the "Empty Cart" button, you will get this list from the Session and call clear() method on the List. This will clear all the contents in the list.
3. invalidate() should be called when the user logs out, so the session is destroyed.