title: Flex ChannelSet.login() caused "Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies."
body: <p>I'm a beginner of blazeds, i wanna integrate spring with blazeds. I followed the "Spring BlazeDS Integration Reference Guide" to configure a simple application. But i have some problems with the integration of security.</p>
  
  <p>Here is my configuration.</p>
  
  <p>services-config.xml</p>
  
  <pre><code>&lt;channels&gt;
      &lt;channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"&gt;
          &lt;endpoint url="http://localhost:8080/test-war/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint" /&gt;
          &lt;properties&gt;
              &lt;polling-enabled&gt;false&lt;/polling-enabled&gt;
          &lt;/properties&gt;
      &lt;/channel-definition&gt;
  &lt;/channels&gt;
  </code></pre>
  
  <p>flex-servlet.xml</p>
  
  <pre><code>&lt;flex:message-broker&gt;
      &lt;flex:remoting-service default-channels="my-amf" /&gt;
      &lt;flex:secured&gt;
          &lt;flex:secured-channel channel="my-amf" access="ROLE_USER" /&gt;
      &lt;/flex:secured&gt;
  &lt;/flex:message-broker&gt;
  </code></pre>
  
  <p>applicationContext-security.xml</p>
  
  <pre><code>&lt;http entry-point-ref="entryPoint"&gt;
      &lt;anonymous enabled="false" /&gt;
  &lt;/http&gt;
  
  &lt;beans:bean id="entryPoint" class="org.springframework.flex.security3.FlexAuthenticationEntryPoint" /&gt;
  
  &lt;authentication-manager&gt;
      &lt;authentication-provider&gt;
          &lt;user-service&gt;
              &lt;user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" /&gt;
              &lt;user name="guest" password="guest" authorities="ROLE_GUEST" /&gt;
          &lt;/user-service&gt;
      &lt;/authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>And in flex part, i have an simple remote object like this,</p>
  
  <pre><code>&lt;s:ChannelSet id="channelSet"&gt;
      &lt;s:AMFChannel url="http://localhost:8080/test-war/messagebroker/amf" /&gt;
  &lt;/s:ChannelSet&gt;
  
  &lt;mx:RemoteObject id="remoteObject" destination="basicFacade" fault="faultHandler(event)"
                   result="resultHandler(event)" channelSet="{channelSet}" /&gt;
  </code></pre>
  
  <p>Then i directly login like this,</p>
  
  <pre><code>var asyncToken:AsyncToken = remoteObject.channelSet.login("admin", "admin");
  asyncToken.addResponder(new AsyncResponder(LoginResultEvent, LoginFaultEvent));
  </code></pre>
  
  <p>Everything works ok, and i success login with the user, but then i call the remote object, i have an error
  <code>[RPC Fault faultString="Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly." faultCode="Server.Processing.DuplicateSessionDetected" faultDetail="null"]</code>.</p>
  
  <p>When i call the remote service 3rd time, the error goes away, it works fine. It seems like when login, it sends two POST to the server, and server create two flex session but only return one HTTP session that cause this question. But i don't know how to solve this. Did i miss something important, or i did somethings wrong at somewhere?</p>