• 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
Controlling Sessions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Controlling Sessions


  • Subject: Controlling Sessions
  • From: Awbrey Hughlett <email@hidden>
  • Date: Mon, 17 Nov 2008 16:49:34 -0600

I was wondering how to control sessions using direct actions and WORedirect. Right now this is how my code looks ...

public WORedirect homeButton() {
    if (context().session() != null) {
    if (((Session)session()).authenticatedUser() != null) {
    ((Session)session()).setAuthenticatedUser(null);
    session().terminate();
    }
    }
    String url = "">"default", null);
    url = "">"&amp;", "&");
    WORedirect redirect = new WORedirect(context());
redirect.setUrl(url);
    return redirect;

This works as long as the session being tested for null has not timed out. This bit of code is in a component at the top of every one of my pages. It controls what happens is a user is logged in. If that particular user in the session is logged in, I want them to automatically be logged out and sent to their intended destination where as here the destination is the home screen. The problem I am having is that when the session times out while the user is still logged in, the button takes them to the session timed out page.

What I want to do:
* When the WORedirect is called, I want the first if statement to test whether there is an active session. If there is, then I want to set the authenticated user to null, terminate the current session if there was a user authenticated, and then redirect them back to the default page.
* If there is not an active session, I want to skip everything about the user, create a session, and redirect to the default page.
* I don't ever want the user to see any kind of 'session timed out' page.

How could I go about doing this?


Thanks,
Awbrey
 _______________________________________________
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

  • Follow-Ups:
    • Re: Controlling Sessions
      • From: David LeBer <email@hidden>
  • Prev by Date: Re: NSMacOSRomanStringEncoding UnsupportedEncodingException
  • Next by Date: Re: Controlling Sessions
  • Previous by thread: Re: Workflow framework?
  • Next by thread: Re: Controlling Sessions
  • Index(es):
    • Date
    • Thread