Duplication session error

We have heard a number of customers who run into duplicate sessions error in LCDS/BlazeDS. To understand why and how it could happen, please see explanation here.

Basically, here are the causes and solution:
1. Cookies are disabled on the client.
solution: turn the cookies on the client.

2. Citrix had a policy to block session cookies.
solution: if you are using Citrix, need to turned it off.

3. The flex app makes two subsequent requests to the server before a session is established on the server for the first request.
solution: there are two options (See details here.):
a). the flex app should make the initial request and waits for its response (so a session is established) before making new requests.
b). trap the duplicate session error on the client and reissue the request. (See details here.)

4. Load balance tool cause subsequent requests to send to different server.
LCDS is a stateful server. This means that when a client makes an initial request to a server, the environment needs to make sure that all the requests from that client ends up on the same server from then on. In this case, you have to make sure your Load balance is configured so that all the subsequent requests from the same client is going to the same server. fail to do so will end up with this duplicate session error.
solution:: Make sure all the subsequent requests from a client end up at the same server.

Note, Some users may want to disable the duplicate session detection to get round the problem. Disabling the duplicate session detection is not an option because it’s a security risk. A single FlexClient is supposed to be associated with a single HTTP based session. If this is not enforced, your app could have some security risk. So, LCDS is checking the duplicate session for you and it should not be ignored. You should always find out and fix the underline problem instead of try to disable the duplicate session detection.

One Response to Duplication session error

  1. Rohit says:

    Problem: Duplicate session errors when flex.war and Livecycle.lca files are hosted in separate JVMs on WebSpehere Server.

    Solution:
    Inside the command file for the event, set FlexClientId to null in execute method before calling remote service (Java method or LC Process).
    I guess this approach can be used in other scenarios as well to prevent Duplicate session errors.

    EventCommand.as file
    —————————–

    import mx.messaging.FlexClient;
    //other import as per your code

    public function execute(event:CairngormEvent):void
    {
    var evt:EventName = event as EventName ;

    var delegate:Delegate = new DelegateImpl(this as IResponder);

    //***set client ID to null
    FlexClient.getInstance().id = null;

    delegate.functionName(evt.data);
    }