In my flex app, where should i store session data?
My business code is exposed in a SOA way and the communication between client code and the backend takes place at very precise moments yet i have to keep variables in the flex client so the user may resume in case of failure. I’d like this flow of events to be feasible.
-
user1 logins and makes some actions
-
failure due to the unexpected events (logout not in due time, exception in client code, closed browser, communications breakdown, etc)
-
user2 logins, makes some actions and commits successfully
-
user1 logins again and resumes where he left in point 2 since the client app loaded the sharedObject for user1
Is this feasible with shraredObjects?, what’s common practice to deal with this?, also i cannot impose the user to tweak her/his browser to accept sharedObjects.
Thanks in advance
P.S: I don’t want to use fine-grained communication between client and business code to control the current state of the client, business code is SOA style, and also the backing-bean used in BlazeDS is heavily loaded.
As soon as
SharedObjectis associative array, you can add current user name to key when you store data:Or even create individual sharedObject file for each user:
But I’d better store current state on server. This can be done on logout or on timer event to prevent heavy communication.