4 Replies Latest reply on Feb 25, 2011 9:27 PM by 2009 Matt

    How does mx:HTTPService support session?

    2009 Matt Level 1

      I have a Flex app and use three mx:HTTPService, which send requests to the same php server (it can also be a Java servlet). php and Java do support

      the HTTP session. Does the three mx:HTTPService use the same HTTP session or three different sessions? If I just use one mx:HTTPService and send

      multiple requests through the same HTTPService, is there a HTTP session covers these HTTP requests?

        • 1. Re: How does mx:HTTPService support session?
          finniflex

          HTTPService piggybacks the browser connection so they are going to be sharing the same session.  However, depending on the browser as in Chrome, each tab is a separate process and will have separate sessions to the server.

           

          To test this out, go to your favorite browser and login to your favorite bank acccount or music site.  Switch to a different tab and visit the same site.  If it shows you are already logged in then you are sharing the same session.

           

          Hope this gives you a lead.

          • 2. Re: How does mx:HTTPService support session?
            2009 Matt Level 1

            I did not see any API in HTTPService that allows me to add and retrieve data on the HTTP session. Do you have an example link that

            shows how HTTPService works with sessions?

            • 3. Re: How does mx:HTTPService support session?
              finniflex Level 1

              It isn't abundantly clear what you are asking.

               

              From the client side, you shouldn't need to know anything about the session per se to do transactions with the server.  Perhaps you can clarify what you are trying to accomplish from a higher level?

              1 person found this helpful
              • 4. Re: How does mx:HTTPService support session?
                2009 Matt Level 1

                You are right, the client should not worry about the HTTP session. It is handled by server.

                 

                If you are running HTML in browser, the browser handles the HTTP sessions for you -- using one of the three ways: cookie, url-rewrite, hidden field, which

                contain the session id generated by server.

                 

                But the swf files can run in Flash Player w/o a browser. Does the Flash Player or mx:HTTPService put the session id in the HTTP request? Where did they put it? I guess it still has to be one of the three ways: cookie, url-rewrite, hidden fields b/c they are the only places where server looks for session id. If it is the mx:HTTPService, how do different mx:HTTPService  share the same session id? Then it should be Flash Player.

                 

                Flex is a rich client. I should be able to see the session id on client side.