I am trying to implement a shopping cart. I have servlet which adds items to a cart, and then sends a redirect to another servlet to display the contents of the cart. If I test this using IE, it works just fine, when I test it using Netscape 4.7, the cart is always empty.
Code this adds to the cart:
HttpSession session = request.getSession(true);
if ( session != null ) {
Vector basket = (Vector)session.getValue("basket");
if ( basket == null ) {
basket = new Vector(5);
session.putValue("basket", basket);
}
// Add the passed in frame to the basket.
basket.addElement(frame);
}
**********************************************************
this reads out of the cart
HttpSession session = request.getSession(true);
basket = (Vector)session.getValue("basket");