When is a session restoration error noticed?
When is a session restoration error noticed?
- Subject: When is a session restoration error noticed?
- From: Robert Tupelo-Schneck <email@hidden>
- Date: Sat, 26 Sep 2009 11:45:44 -0400
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden