• 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: Session termination code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Session termination code


  • Subject: Re: Session termination code
  • From: Jonathan Rochkind <email@hidden>
  • Date: Mon, 19 May 2003 11:21:35 -0500

I think terminate() should be called even for timeout. Are you sure it isn't? Where in the documentation do you see something that suggests it won't be?

I'm pretty sure it is. The one case where I know it won't be called is if the Application is shut down (or dies unexpectedly, of course) while there are existing sessions. Those sessions will not have terminate() called. In the case of an unexpected death, obviously, but in the case of an intentional application shutdown too. If you want to clean up after existing still active sessions when shuttting down an application---I'm not really sure how to do that.

--Jonathan

At 06:05 PM 5/16/2003 +0200, Paul-Liviu Petrus wrote:
Hi all,

In my app, the users have a flag 'online' in the database, which is set
to 1 when the user logs on and should be set to 0 when he/she logs off.
I implemented the method session.terminate() to do the job.

    public void terminate()
    {
        // ...
            authPerson.setOnline( new Integer( 0 ) );
            authPerson.setLogoutTime( today );

        //...
        defaultEditingContext().saveChanges();

        super.terminate();
    }

When the user logs out 'normally', this works. The problem is, when he
doesn't logout, but simply closes the browser, then the method
terminate() is not automatically called by the server, even if the
session is destroyed (according to the docs) after timeout() and he
stays 'online'.

Is there another method, which _is_ called when a session is destroyed
and where I could put my code? I didn't find anything yet.

Thanks a lot

Paul.
_______________________________________________
WebObjects-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
_______________________________________________
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: 
 >Session termination code (From: "Paul-Liviu Petrus" <email@hidden>)

  • Prev by Date: Re: Localization
  • Next by Date: [solved] Session termination code
  • Previous by thread: Re: Session termination code
  • Next by thread: WOXMLCoder/decoder bug with optional to-one relations?
  • Index(es):
    • Date
    • Thread