[solved] Session termination code
[solved] Session termination code
- Subject: [solved] Session termination code
- From: "Paul-Liviu Petrus" <email@hidden>
- Date: Mon, 19 May 2003 18:33:23 +0200
- Thread-topic: Session termination code
Thanks Jonathan, Chuck and all who answered.
It really works this way. Didn't find anything in the docs to say that
terminate() wouldn't be called but didn't also find anything to say that
it would.
Good luck to you all,
Paul
-----Original Message-----
From: Jonathan Rochkind [mailto:email@hidden]
Sent: Montag, 19. Mai 2003 18:22
To: Paul-Liviu Petrus; email@hidden;
email@hidden
Subject: Re: Session termination code
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.