I am trying to create a webapplication, which will use a js front end and invoke Spring WS in the backend. Let's say this is a shopping site kind of website. So, I could have services like OrderService
InventoryService
ShippingService
and so on. The only thing that needs session is the shopping cart of the user. Now, just for this shopping cart, does it make sense to use a servlet container for session management? Or, should I have CartService
that persists session information to the database?
What is the best practice when it comes to session management with WebServices? I guess, the best practice really is to keep the service stateless, but how can I authorize users if I have stateless webservices?
Is it a good practice at all to use a servlet container just to do session management and then have different controllers acting as proxies to the webservices?
I am attaching a picture to make you understand the context better.