It seems that the issue is with the Node server that runs with Moonshine, exporting to a tomcat server the correct calls are made and no duplicate sessions occur.
Thank you all for your help. On 2021/03/09 09:15:58, David Slotemaker de Bruine <[email protected]> wrote: > Hi Safrizal, > > I only just found your reply now as it got buried in the thread and I was off > trying to fic everything else. > > Back on the server side of things now and want to implement your solution. > > I have to use MX:RemoteObject as my existing backend is BlazeDS 4.0.1. I > would like to keep using the sessions as that is what is already implemented. > > I am using CRUX with Apache Royal. How do I implement your solution when > using serviceHelper.executeServiceCall? > > I have noticed using CharlesProxy that the first ping call from Royal is not > the same as from an AIR client. The AIR client is sending a POST AMF Message > Operation 5. > > But the ApacheRoyal is just sending the following with no body: > > OPTIONS /SERVER/messagebroker/amf.txt HTTP/1.1 > Host: XXXXXXX8400 > Pragma: no-cache > Cache-Control: no-cache > Accept: */* > Access-Control-Request-Method: POST > Access-Control-Request-Headers: content-type > Origin: http://localhost:3000 > User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 > (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36 > Sec-Fetch-Mode: cors > Referer: http://localhost:3000/ > Accept-Encoding: gzip, deflate > Accept-Language: en-US,en;q=0.9 > > I am sure that this is the problem, but I don't know how to fix it. > > Any ideas? > > David > > > > > > On 2021/02/10 16:49:47, Safrizal <[email protected]> wrote: > > do not use cookies, use stateless session. > > > > if you still have to use cookies, you should check blazeDS > > AppendToGatewayUrl message, > > after command message PING / Operation 5, executed. > > > > check message.headers, if name == 'AppendToGatewayUrl' and mustUnderstand == > > true, > > save jsession value. > > > > and use jsession value, > > > > requestQueue.push( > > { > > url: url + jsession, > > targetURI: command, > > responder: responder, > > args: params > > } > > ); > > > > then our friendly message, "Detected duplicate HTTP-based FlexSessions, > > generally due to ..." gone, and no double call. > > > > but, if you want to use stateless session, ignore jsession, then you can > > force null to royale header. > > > > protected function setRoyaleClientIdOnMessage(message:IMessage):void > > { > > //var id:String = RoyaleClient.getInstance().id; > > //trace("[*setRoyaleClientIdOnMessage] RoyaleClient.getInstance().id: " > > + RoyaleClient.getInstance().id); > > //message.headers[AbstractMessage.ROYALE_CLIENT_ID_HEADER] = (id != > > null) ? id : RoyaleClient.NULL_ROYALECLIENT_ID; > > > > message.headers[AbstractMessage.ROYALE_CLIENT_ID_HEADER] = > > RoyaleClient.NULL_ROYALECLIENT_ID; > > } > > > > and there is no "Detected duplicate HTTP-based FlexSessions, ...", no double > > call. > > > > use jwt or paseto or macaroons or others.( I use JPaseto) > > and of course, you should aware about session housekeeping, > > caused by too many BlazeDS flexSessions creation, hdr(DSId) always null. > > > > i use JS::RemoteObject, because MX::RemoteObject is very "mbulet" (in > > Indonesian, meanings Complicated), > > there are Channels, Channelset, Operation, AsyncToken and Responders, just > > to call a function. > > > > i build latest royale-asjs develop branch using maven, and code with VSCode. > > > > > > > > Salam, > > > > > > Rizal > > > > > > > > > > -- > > Sent from: http://apache-royale-users.20374.n8.nabble.com/ > > >
