This is a bit tricky because concurrent access to a single session
could cause problems. Consider this:
1) User A makes a request and their session data is retrieved.
2) User B retrieves session data for User A.
3) User A makes changes to their session and saves it.
4) User B makes changes to the retrieved session data for user A - but
the session being changed is stale! (it was retrieved before User A
saved changes to their session).
5) User B saves the changes made to User A's session - wiping out the
changes User A just made to their own session in (3).
A safer approach would be to store the shared data under its own
unique memcache key. If you can segment the shared data such that it
only has a single writer, then you don't even need to worry about
concurrent access to it. On the other hand, if the shared data may be
accessed for writing by more than one request/user at a time, then you
could protect it from concurrent modification with a memcache
"lock" (use memcache.add() to try to acquire the "lock", and
memcache.delete() to free it).
~ David