Hi,
On our welcome page, we have two small apps that display advertisement; they are both identical and use BlazeDS. When the welcome pas shows, I always have one of the app that receives this fault :
[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"]
I feel the problem comes from the fact that two apps from the same page access the same service at the same time. Am I wrong?
Hi. I believe you are right. Using a HTTP sniffer such as Charles to look at the HTTP headers would tell us exactly what is happening but I think we can assume that you are in the ballpark.
If the server gets a request with no session cookie header, I think it will create a new session and then send a Set-Cookie header on the response with the new session id. It is likely that if both your apps are making their initial requests to the server at roughly the same time that neither of the requests has a session cookie header. In that case the server is probably creating two sessions, one for each request and that is likely causing problems.
While I haven't tested this particular scenario, I have been doing some testing around session cookie handling in BlazeDS recently. I would see if you can workaround this problem by already having a HTTP session established with the server before either of your apps runs. One way to do this would be by having a jsp page redirect to your welcome page. The call to the jsp page would cause a session to get created on the server. The server would return a Set-Cookie header with the new session id. The browser would then request the welcome page sending a session cookie header on the request. Your apps would load. Each app would make its initial request to the server only this time the requests would contain a session cookie header for the same valid HTTP session. . . and you would avoid getting duplicate session detected errors. . . at least that's I hope would happen.
If I have some free time I will try running through this scenario (having two small apps on the same page) and report back.
Hope that helps.
-Alex
Sure, you can log a bug for this at http://bugs.adobe.com.
Even if it's not something we can fix in the BlazeDS code, we should at least come up with and document a reasonable workaround as you are right that it is probably a fairly common use case.
-Alex
It is bug #BLZ-410 (https://bugs.adobe.com/jira/browse/BLZ-410)
Hi Anil, Thanks for the reply. Even we are using the single application only. But some times we keep getting that and I am not able to rectify till I restart the server... Today to my surprise that restarting server also didn't help :-( So in code when your application started u are just making one dummy call like this? <mx:HTTPService id="photoService" url="http://myserver:80/index.html" resultFormat="e4x" result="ResultHandler(event);" fault="FaultHandler(event);" /> And then u are staring RO calls to blaze DS? Else please post me your code. Thanks in advance. regards Vamsi
Hi. For anyone who is still interested in the duplicate session detected errors problem I have blogged about it here and proposed some workarounds.
http://www.alexglosband.com/?p=3
-Alex
North America
Europe, Middle East and Africa
Asia Pacific