5 Replies Latest reply on Sep 19, 2007 5:52 AM by Robert_Csiki


      I want to make sure all the server-side resources are being cleared upon a Logout operation executed from a Flex application. Also I want to handle the situation same thing happens server-side when the user simply bypasses the Logout and kills their browser window (so the connection with the FDS gets broken).

      How to proper implement that on the server?

      Trying to mimic the standard http "logout", I used FlexContext.getFlexClient().invalidate(), but then I realized on the next Login, FDS will reuse the same FlexClient object, which is still in the invalidate state (??) hence all the operations performed with it would fail. Should I try invalidating all the associated FlexSession instead, so the FlexClient would get automatically invalidated?

      During normal client operation, FlexClient objects have associated multiple FlexSession objects (http and rmtp). As FlexSession can have associated multiple FlexClient and viceversa, I am a bit confused on how to do the logout or handle a broken connection, server side.

      I'm working with the out-of-the box FDS configuration files, the only things I added are destination definitions for mky Remote Objects and Data Services.

      Thank you.
        • 1. Re: Logout?
          Hello Robert,

          I have the same problem.
          I got a java serverside with a flex client. So at serverside i created a class that extends AbstractBootstrapService (so it is loaded as Flex Service from services-config.xml) and it implements FlexSessionListener interface - listens for sessions created and closed. But i feel a real lack of knowlege how flexSession works and how to properly configure it.
          At the moment the session destroys (and my SessionListener class performes all its *user logged off* work ) 5 minutes after the browser is closed, and i have no guesses how to make it faster/
          • 2. Re: Logout?
            ah, got it, just a <session-config> section in WEB-INF/web.xml
            • 3. Re: Logout?
              Robert_Csiki Level 1
              You saying your listener method gets called 5 mins after the Logoff?
              • 4. Re: Logout?
                Ansire Level 1
                yes, if the browser just closed, without calling *log off* method, then i listen to destroying sessions, get client id from it and do log off for this client (clearing serverside data on it and so on)

                i tried to tune timeout setting at <session-config> in web.xml - but the session still dies only 5 minutes after the browser is closed.
                • 5. Re: Logout?
                  Robert_Csiki Level 1
                  You are lucky with your 5 minutes. I just tried with my environment (LCDS is deployed on Tomcat 5.5), keeping all the default settings, killed my browser after connecting (I do have both HTTP and RTMP connections created), and noticed the following:

                  - the RTMP session was instantly invalidated
                  - the HTTP session was kept alive for exact 30 minutes, then it was invalidated (and at that point the FlexClient was also invalidated, as it contains no more sessions).

                  I'm looking at ways to set that session timeout value now, to be less than 30 minutes.