• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
When is a session restoration error noticed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: [SOLVED] direct actions and the current editing context
  • Next by Date: D2W Edit Lists as shown in WOWODC 09 talk
  • Previous by thread: [SOLVED] direct actions and the current editing context
  • Next by thread: Re: When is a session restoration error noticed?
  • Index(es):
    • Date
    • Thread