radubirsan opened a new issue, #1239:
URL: https://github.com/apache/royale-asjs/issues/1239

   I am trying to create a proof of concept that will maybe get me a job in 
porting a AIR/Flex project. Trying to login to the server gives a Duplicate 
Session error. Here is the Royale code:
   
   ```
   <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                      xmlns:mx="library://ns.apache.org/royale/mx"
                      width="600" height="400" initialize="setUp()" >
        <fx:Script>
                <![CDATA[
                        import mx.rpc.AsyncToken;
               import mx.rpc.Responder;
               import mx.rpc.events.FaultEvent;
               import mx.rpc.events.ResultEvent;
                        import mx.messaging.ChannelSet;
               import mx.messaging.channels.SecureAMFChannel;
               import mx.messaging.RoyaleClient;
               import mx.utils.UIDUtil;
   
                        public var serverSTUB:String = 
"https://3cserver.3cnecectlab.net:9443";
                        public function setUp():void
                        {    
                var amfChannel:SecureAMFChannel = new 
SecureAMFChannel("my-secure-amf",serverSTUB + "/RiaService" + 
"/messagebroker/amflongpolling");
                   amfChannel.requestTimeout = 10;
                   channel.heartbeatInterval = 30000;
                   RoyaleClient.getInstance().id = 
UIDUtil.createUID()//Math.round(Math.random())+ 
"9AB13FB-B51D-48F8-9EC9-2E06EC061EB5";
                   channel.addChannel(amfChannel);  
                        }
               public function login(e:MouseEvent=null):void{
                   var r:Responder = new Responder(handleAuthenticateSuccess, 
handleLoginFault);
                   var token:AsyncToken = channel.login('RBIRSAN', 
"Un1verge3Cst2020@");
                   token.addResponder(r);
                   trace("the token: ", token);  
               }
                        private function 
handleAuthenticateSuccess(event:ResultEvent = null, token:Object = null):void
                        {
                                btn.label =  event.toString()   
                        }
                        
                        private function handleLoginFault(event:FaultEvent = 
null, token:Object = null):void
                        {
                   btn.label =  event.toString()                
                        }
                ]]>
        </fx:Script>
         <fx:Declarations>
            <mx:ChannelSet id="channel">
            </mx:ChannelSet>      
       </fx:Declarations>
    <mx:Button label="RemoteObject AMF Test" click="login(event)" id='btn'/>   
   </mx:Application>
   ```
   
   Here is my asconfig:
   ```
   {
        "compilerOptions": {
                "targets": [
                        "JSRoyale"
                ],
                "source-path": [
                        "src"
                ]
        },
       "additionalOptions": "+configname=flex",
        "mainClass": "Main"
   }
   ```
   
   I am starting chrome like this bypass CORS errors:
   `chrome.exe --user-data-dir="C://chrome-dev-disabled-security" 
--disable-web-security --disable-site-isolation-trials`
   
   I get this response:
   Duplicate HTTP-based FlexSession error: A request for FlexClient 
'585E2208-67F8-C428-0452-65840DD101A8' arrived over a new FlexSession 
'ECD144ED710A291AE3E5C1D17560B501', but FlexClient is already associated with  
FlexSession '42A03B06B6FA9FED2AC03F7B3E14DB73', therefore it cannot be 
associated with the new session.
   
   
   Loging at network trafic I see 3 requests all with diferent JSSESSIONID:
   
![image](https://github.com/apache/royale-asjs/assets/3396903/5854cf30-44af-4257-8696-232c6205f5be)
   
   
   Any help in solving this is much appreciated, thank you
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@royale.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to