I'm playing around with a simple application and I decided to try
this: when a user logs in, check and see if that user already has a
session, and if so, terminate it.

I'm just storing an array of sessions in memory, adding a session to
it in the session constructor and removing it in Session.terminate().
When a user logs on, I look through the sessions, and if one is for
the same user I terminate it.

This works reasonably well.  But: when I click an AjaxUpdateLink on a
page under a terminated session, the action takes effect---including
session().defaultEditingContext().saveChanges(), so the changes reach
the database---and THEN my Application's
handleSessionRestorationErrorInContext is called.

Well, I managed to prevent that by putting this in the component:
    @Override
    public WOActionResults invokeAction(WORequest request, WOContext context) {
        if(session().isTerminating()) return
application().handleSessionRestorationErrorInContext(context);
        return super.invokeAction(request,context);
    }

So everything seems to work fine.  But it leaves me with the question:
When in the Ajax-enabled request-response loop is a session
restoration error noticed?

Thanks,
Robert
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to