• 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
Re: How do I do a logout?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I do a logout?


  • Subject: Re: How do I do a logout?
  • From: Art Isbell <email@hidden>
  • Date: Thu, 18 Mar 2004 17:02:21 -1000

On Mar 18, 2004, at 4:23 PM, David Elsner wrote:

Bind a hyper link to this:

   public LogOutPage logOut()
     {
         LogOutPage nextPage = (LogOutPage)pageWithName("LogOutPage");

         ((Session)session()).terminate();

         return nextPage;
     }

Dave

On 19/03/2004, at 12:01 PM, James Cicenia wrote:

Ok -

this has to be simple.. how do I logout correctly my user?
i.e. terminate session and redirect user to a login page?

It's been a while since I looked into this, but I don't think it's that simple. When I last looked, returning a page via a component action created a new session. So the above would terminate the current session and start a new session. If that's what you want, fine, but I wanted no session created until my sign in page (Main in my case) was displayed. So this is what I ended up doing to avoid session creation:


public WORedirect signOut() {
WORedirect nextPageL = (WORedirect)pageWithName("WORedirect");
nextPageL.setUrl(context().directActionURLForActionNamed("signOutAction" , null));
session().terminate();
return nextPageL;
}


	And in DirectAction.java:

    public WOActionResults signOutAction() {
        return pageWithName("SignOut");
    }

On my SignOut component, I have a link to my sign in page. Unless you're careful, displaying your sign in page could create a new session. Sessions are pesky things to avoid :-)

Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: How do I do a logout?
      • From: Robert Walker <email@hidden>
References: 
 >How do I do a logout? (From: James Cicenia <email@hidden>)
 >Re: How do I do a logout? (From: David Elsner <email@hidden>)

  • Prev by Date: Re: 5.2.3 Problem with Schedualing
  • Next by Date: Re: refreshesRefetchedObjects significant hit on efficiency
  • Previous by thread: Re: How do I do a logout?
  • Next by thread: Re: How do I do a logout?
  • Index(es):
    • Date
    • Thread