Re: Session termination code
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.