Groups | Blog | Home
all groups > macromedia flash flashcom > august 2006 >

macromedia flash flashcom : Session management with FMS2 and Remoting


h-nemokid
8/1/2006 12:36:50 PM
hi all,
i create an FMS2 application that work as a proxy between my Flash client and
a java webapp that export a service via Remoting.
When the client connect to FMS i create a new connection to the Remoting
service with the following code:

I create this method on my Client object:

Client.prototype.createConnection = function(){
// Connect to the gateway
if(this.gatewayConnection == null){
this.gatewayConnection =
NetServices.createGatewayConnection(ServerConfiguration.URL) ;
this.remotingService =
this.gatewayConnection.getService(ServerConfiguration.REMOTI NG_SERVICE,this);
}
}

When a client connect i use this code:

/**
* onConnect
*/
application.onConnect = function(p_client) {
//disable write access
p_client.writeAccess = "";
p_client.start_time = (new Date()).getTime();
p_client.createConnection();
}


Everything works fine but i've got problems with HTTP sessions management.
At the first request my tomcat server create a new HTTP Session and send a
cookie to FMS2.
From that point all the request starting from that FMS2 server will use the
same cookie.
From my logs i'm sure i create a new connection for every client, sniffing
with ethereal i can see different HTTP connection for every client but all the
different connection send allways the same cookie to the tomcat server.
I need to have a new HTTP Session for every client but it seems that creating
a new connection with NetServices.createGatewayConnection is not enough.

There's a way to have FMS2 accepting a new cookie for every remoting
connection?

Previous version of the application (that was based on FCS1.5) works well.

I made a try also using loadVars function and i get the same result, all
following request use the same session cookie so all requests are executed, on
tomcat, in the same session.

thanx for your help
nemokid
Fabio Salvadori
8/9/2006 3:27:56 AM
After a lot of test it seems that FMS2 use the same cookie object for
all HTTP connection to the same address.

I made some try using loadVar and XML.load and results are allways the
same. In the first response FMS2 receives the cookie from the AS with
the sessionId. After that every request to the same AS contains the
same sessionId value nevermind if i'm creating a new connection.

It really seems an FMS2 bug for me.
Any one else is having problems using HTTP services from FMS2?

By now i must modify my application to be session indipendent and it's
really annoying!

thanx for the help
fabio

h-nemokid ha scritto:

[quoted text, click to view]
AddThis Social Bookmark Button