Re: WOSession.SessionDidTimeOutNotification oddity (was: app closing method)
Am 05.08.2014 um 16:54 schrieb Klaus Berkling : > > On Aug 5, 2014, at 1:04 AM, René Bock wrote: > >> But my tests shows, that the WOSession.SessionDidTimeOutNotification is send >> every time a session terminates – regardless if the session was timed out or >> terminated explicitly >> . >> Which is bad, as I only want to take an action on session time out :-( > > > Can you set a flag in your session class when someone explicitly terminates > the session, in your logout code? Then act accordingly in terminate() if the > flag was not set? > Yes, but i preferred this one: public void terminate() { if(this.toString().contains("_wasTimedOut=true")) { NSNotificationCenter.defaultCenter().postNotification(MySessionWillTimeOutNotification, sessionID()); } super.terminate(); } _wasTimedOut is set to true only when session.terminate() is called when the session time out is reached. But unfortunately, _wasTimedOut is a private instance variable from WOSession :-( > > kib > > "Some people never see the light, Till it shines through bullet holes." > Tropic Moon, Burce Cockburn > > Klaus Berkling > www.berkling.us | @kiberkli | Photography > > > > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/bock%40salient.de > > This email sent to b...@salient.de Mit freundlichem Gruß, René Bock Software Engineering -- salient doremus http://www.salient.de http://www.openforms.de ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WOSession.SessionDidTimeOutNotification oddity (was: app closing method)
On Aug 5, 2014, at 1:04 AM, René Bock wrote: > But my tests shows, that the WOSession.SessionDidTimeOutNotification is send > every time a session terminates – regardless if the session was timed out or > terminated explicitly > . > Which is bad, as I only want to take an action on session time out :-( Can you set a flag in your session class when someone explicitly terminates the session, in your logout code? Then act accordingly in terminate() if the flag was not set? kib "Some people never see the light, Till it shines through bullet holes." Tropic Moon, Burce Cockburn Klaus Berkling www.berkling.us | @kiberkli | Photography smime.p7s Description: S/MIME cryptographic signature ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
WOSession.SessionDidTimeOutNotification oddity (was: app closing method)
I have a similar requirement than Ted. But my tests shows, that the WOSession.SessionDidTimeOutNotification is send every time a session terminates – regardless if the session was timed out or terminated explicitly . Which is bad, as I only want to take an action on session time out :-( Am 22.07.2014 um 17:30 schrieb Hugi Thordarson : > You can override WOSession.terminate() or listen for > WOSession.SessionDidTimeOutNotification. > > Cheers, > - hugi > > > On 22.7.2014, at 15:26, Theodore Petrosky wrote: > >> If I am in my app, and a session was created, is there a method (that I can >> override) that is called when the session terminates? Specifically, if the >> user closes the window (does not log out), I want to do some cleanup before >> the session disappears totally. >> >> Ted >> regards René Bock -- salient doremus - Lindleystraße 12 60314 Frankfurt Main http://www.salient.de http://www.openforms.de ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
app closing method
If I am in my app, and a session was created, is there a method (that I can override) that is called when the session terminates? Specifically, if the user closes the window (does not log out), I want to do some cleanup before the session disappears totally. Ted ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: app closing method
You can override WOSession.terminate() or listen for WOSession.SessionDidTimeOutNotification. Cheers, - hugi On 22.7.2014, at 15:26, Theodore Petrosky wrote: > If I am in my app, and a session was created, is there a method (that I can > override) that is called when the session terminates? Specifically, if the > user closes the window (does not log out), I want to do some cleanup before > the session disappears totally. > > Ted > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is > > This email sent to h...@karlmenn.is ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com