Skip to main content
Participant
April 19, 2006
Question

loadVars+server side asc+php sessions

  • April 19, 2006
  • 1 reply
  • 350 views
Hi,

Its easy to grap php sessions from client side flash ,but how can i pass the user session id to server side asc.

I want to write some text to a database when the user close the browser and trigger the application.onDisconnect function. Its no problem with loadVars but how can i pass the client session id to the server side application.onDisconnect function.

Thx
    This topic has been closed for replies.

    1 reply

    April 19, 2006
    I think the easiest way (assuming the PHP session starts before the .swf connects to FMS) woul be to have the client .swf pass the PHP session ID to FMS in the connect statement. Then you have the session ID to send to PHP when the user disconnects.
    ViktorrAuthor
    Participant
    April 20, 2006
    So I need to pass session here:

    myConnection_nc.connect("rtmp:/mySecondApp/myInstance", "someUser", phpsession_id);
    And I get it in main.asc:
    application.onConnect =function(newClient,newUserName,phpSessionId) {
    newClient.phpSessionId = phpSessionId;
    }

    But how can I access this in the onDisconnect function?

    application.onDisconnect = function(client)
    {

    }