• 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: "Peter Fournier" <email@hidden>
  • Date: Fri, 19 Mar 2004 00:35:25 -0500

If you put a session().terminate() within your appendToResponse() or your
constructor on your logout page it can be a WO page. I have had success with
this and avoided having to have an external static page. The logout page
usually just has a simple message and a link back into the app if the person
wants to log back in if they hit log off by accident.

--------------------

Pete Fournier
email@hidden

Play in a Hockey league? Check out HockeySite at www.fournierware.com and
get your stats online.

-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Robert Walker
Sent: Thursday, March 18, 2004 11:52 PM
To: WOdev List List
Subject: Re: How do I do a logout?


There is one "sure fire" way to prevent the creation of another
session.  You could use the WORedirect to take you to a "static" web
page.  You could then put a hyperlink on that page to get back to a
sign-in page.  Probably not necessary, but would definitely avoid a new
session after logging out.

It is definitely true that if component request handling is used you
will immediately get a new session.  The only solution I know of, as
explained previously, is to use a direct action to display a page that
has absolutely NO references to session.  Also any reference to
session() within a direct action will obviously create a session if a
session ID is not available.

On Mar 18, 2004, at 10:02 PM, Art Isbell wrote:

> 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.
>
>
--
Sincerely,
Robert Walker
_______________________________________________
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.
_______________________________________________
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.


References: 
 >Re: How do I do a logout? (From: Robert Walker <email@hidden>)

  • Prev by Date: Re: Losing my mind
  • Next by Date: Re: Boolean and 5.2.3 my experience
  • Previous by thread: Re: How do I do a logout?
  • Next by thread: Boolean and 5.2.3 my experience
  • Index(es):
    • Date
    • Thread