the container needs to create a unique session for this client (e.g. online shooping),
Given that a shopping cart is a business operation, it seems to make sense to keep the session with an EJB. If you actually want to record the customer's choices between session, you'll have to do more than that and store it to a database, so entity beans or other data access methods may be required.
is the ejb referrence stored in an object on java client, or similar to web client, there should be some object on the application server to store referrence?
The Java client of a stateful session bean has a reference to it's very own bean instance - (one reason for controversy over scalability with stateful session bean).
I only know that web client use httpSession object to keep referrence to ejb object. HOw about java client? confusing.
The HttpSession uses cookies or url rewriting to maintain the link between web browser and the web server - no EJBs are involved here. You use a Java client to maintain a session with a stateful session bean. No need to get confused.