1 Reply Latest reply on May 31, 2010 2:29 AM by Gregor.Kiddie

    Cookie set on the request from flex disappers

    Ashish Kumar OP



      I need to set cookie for calls from flex. So on the server side I set the cookie and send the response back to flex. I used tools like tamperdata and debugbar to monitor the request calls and I found that the cookie i set is available + a

      JSessionID cookie is also available in the response headers "

      Set-Cookie".Since cookie is set on the response headers, it is expected to be available in all the next successive calls.
      But on my next successive call I see only the the Jsession id for all the calls. And in some call i see the cookie I set.


      I use caringorm framework. So far I have analysed and found that if the call goes from same delegate I see my cookie, but if its from different delegate then i don't see the cookie in the request. I tried using same delegate for all my commands by creating objects of the same delegate but still it didn't work.


      I feel creazy when i thing why only JseesionId is available in the cookie and not the one which i set in the calls irrespective of the delegate. I am not sure where i am going wrong. Even when i try to do document.cookie in the external interface call or in the URL using Javascript alert I only see a empty string not ven the Jsession id in the document.cookie. some thing is really creazy.


      Sicne result event does not have the option of cookie, is flex eating the cookie set on the response. Then why on Jsessionid is available? I have also seen that in HTTPServiceMessage has an option of recordHeaders. Is my isseu is related to this. If so please let me know an example to use this. I am going insane with this issue. Please help!!
        • 1. Re: Cookie set on the request from flex disappers
          Gregor.Kiddie Level 2

          It's probably not the same delegate you need to hit, but exactly the same HTTPService.


          This is a bit I've gleaned from encountering similar issues, so it might not be exactly right!


          The Flash Player attaches the cookie info into the Channel that is used to make the call. If you want the same cookie, you need to use the same Channel.

          The jsessionid you are seeing is the way the same session is indicated to back end resources, so if two Flash apps hit the same service it knows they are different.


          The way I'm currently playing with, is to keep the ChannelSet around and inject it into Services as I need them, that's covering most of my problems!