RTC Forums
November 24, 2024, 06:02:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: OnSessionClose Event  (Read 4640 times)
HelgeLange
RTC Expired
*
Posts: 100


« on: May 31, 2015, 05:23:25 PM »

Hi Danijel,
I'm implementing sessions atm. and I wonder if there is a way to know, which session is gone in the OnSessionClose event.
The variables I had saved there are gone.
The workaround I'm writing now is the use of a TRtcObject sabed in the Session.Obj['MyObj'] property, that should get killed when the session closes and I get to throw an event with the data I need to clean up my stuff (like notifying the monitor app which client has disconnected through other ways than Logout, i.e. Timeout)

So any way to make it easier ?
Thanks in advance...

Helge Lange
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: May 31, 2015, 06:02:23 PM »

The Session being closed will be accessible through the TRtcDataServer(Sender).Session variable in the OnSessionClose event.

Best Regards,
Danijel Tkalcec
Logged
HelgeLange
RTC Expired
*
Posts: 100


« Reply #2 on: May 31, 2015, 09:08:53 PM »

I know Smiley
But the variable inside isn't there anymore Smiley

So If I call logout (A remote function), I can access the TRtcDataServer(Sender).Session.asInteger['MyId'] and I get let's say 30
In the OnSessionClose event I get 0
I checked both with debugger and CodeSite
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: June 01, 2015, 12:43:05 AM »

If the data is no longer in the Session variable, then you must have cleared it already (or it is not the Session you were expecting), because RTC does NOT make any changes to Session data. RTC will ONLY destroy the Session object (along with any data stored inside) after the OnSessionClose event.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 17 queries.