You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Mone Dimi <al...@gmail.com> on 2011/06/29 23:34:52 UTC
SESSION VARIABLE getting erased/lost when going between Java Services
on different ports and PHP clients
I have 3 php scripts and 2 Java Services Running on two different ports
login.php
home.php
other.php
login.php is just a form that accepts a username via POST
so home.php has something like
$_SESSION['username'] = $_POST['username'];
$user =$_SESSION['username'];
$result = $client->FirstJavaService();
echo $user;
echo $result;
Both $user and $result are not NULL and results are printed out as expected.
Now other.php has a form for passing a term into a second Java Service
listening on a second port. It is something like
$curr_user = $_SESSION['username'];
$term = $_POST['term'];
$other_result = $client->SecondJavaService();
echo $curr_user;
echo $other_result;
When a term is entered into the form on home.php we arrive at other.php with
$other_result printing out fine, but $curr_user becomes NULL, implying that
the $_SESSION['username'] variable got wiped out.
Is it because the services are on different ports? I would think that since
defining multiple services is fine, one should be able to keep a session
variable between different php clients.
All help is appreciated!
Thanks!
M