Hi James,
A Play instance does not maintain session data, so it'll be hard to
know when a session is created (we could) and when it's destroyed (I
don't think we can). The entire session data lies in the session
cookie, so you can't put much data (4Ko) or sensible data in there.
Play will only ensure that session is not altered by a crypto check,
that's the server key you find your application.conf file. Should you
want to distribute your app over a cluster, the play instances will
only need to share this key.
So, you have to place your cart related data elsewhere. If you
consider it temporary until the cart is checked out, go for the cache.
If you consider that it's more persistant, go for a database model.
I'd choose solution 2 under standard uses cases. Solution 1 will also
work out of the box, you'll just have to deploy a memcached if in
clustered environment.
Regards,
Jean-Francois