Category Image Logging out of a session


The objective of logging out of a session is to terminate the current user's "logged in" access to data so they can safely leave their workstation, dispose of the current session object to free up memory, and return the user to a non-session page.
Searching the list will show you many suggestions on how to accomplish this. Unfortunately many of the recommendations simply do not work. Here is what works for me and is based on list input by Chuck Hill and Arturo Perez....

Create a component that will be displayed after logout. The component should have no session bindings on it. Keep it simple initially and put a Direct Action link that triggers a direct action to return your login page. Let's say your direct action is named logoutPage

On your component containing the log out functionality, make a link that binds to an action named logMeOut (for example). The finished logMeOut method should look like this..........

public WORedirect logMeOut()
{
WORedirect nextPage = (WORedirect)pageWithName("WORedirect"); //1
nextPage.setUrl(context().directActionURLForActionNamed("logout", new NSDictionary(Boolean.FALSE, "wosid") )); // 2
session().terminate();
return nextPage;
}

// 1) Note there is no page named "WORedirect" in your project .... just type it as you see it

// 2) the argument "logout" corresponds to the direct action named logoutAction

Posted: Friday - April 30, 2004 at 06:09 PM        


Published by