Skip to main content
March 29, 2011
Question

Why the server side behavior of LoadVars() not consistent?

  • March 29, 2011
  • 1 reply
  • 1536 views

In my server side script for FMS app,there is such code:

var lv = new LoadVars();

var params = new LoadVars();

...

lv.send("http://mysite.com/registerVideo.php", params, "POST");

The expected behavior is that the request will be as if sent directly from the browser,thus SESSION information is not lost ,which is the exact behavior for my computer.

But it's not the case for my boss --- session information is lost for him.

Why the server side behavior of LoadVars() not consistent?

What do I need to do to make sure session information is not lost @ server side ?

    This topic has been closed for replies.

    1 reply

    March 29, 2011

    The PHP session belongs to the client, but the request comes from the server. Therefore, the php session is not relative to the server.

    What you can do is pass the PHPSESSID to the server from the client, include the PHPSESSID variable in your server side loadVars request, and then use session_id() on the php side to set the session id before starting the session.

    March 29, 2011

    @JayCharles

    thanks for reply!

    But on my computer,it behaves exactly as if sent from my browser,

    and it can be caught in firebug!

    Isn't this an official feature of FMS that I've been leverage so far?

    March 29, 2011

    You're saying that Firebug is catching requests being made by FMS? I wouldn't have expected that... is FMS running on the same machine you have Firefox running on?