Re: WOSession.SessionDidTimeOutNotification oddity (was: app closing method)
Re: WOSession.SessionDidTimeOutNotification oddity (was: app closing method)
- Subject: Re: WOSession.SessionDidTimeOutNotification oddity (was: app closing method)
- From: René Bock <email@hidden>
- Date: Tue, 05 Aug 2014 17:05:56 +0200
Am 05.08.2014 um 16:54 schrieb Klaus Berkling < email@hidden>: 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
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden