Help getting Sessionsconfigured on my webserver
Posted: Thu Dec 03, 2009 4:44 pm
Hello,
I am not new to php, but am new to using sessions. I was trying to get sessions working between files with 2 simple test files, 'test1.php' and 'test2.php'.
test1.php:
test2.php:
As you can see, it's a very basic test to prove that the variable 'data' is passed and displayed on test2.php. Unfortunately, this variable does not get passed on my webserver: http://johnhilp.com/test1.php
To confirm that it's some type of configuration issue I tried it on another webserver and it did work with the exact same files. So what kind of configuration issue should I look into? Or what obvious answer did I miss? Thanks in advance.
I apologize in advance if I missed a sticky or other easily searchable post that had my answer. I searched the forums and couldn't find anything.
I am not new to php, but am new to using sessions. I was trying to get sessions working between files with 2 simple test files, 'test1.php' and 'test2.php'.
test1.php:
Code: Select all
<?php
session_start();
$_SESSION['data'] = "you have an active session!";
echo "<a href=\"test2.php\">go</a>";
echo " and please pass this: " . $_SESSION['data'];
?>Code: Select all
<?php
session_start();
echo $_SESSION['data'];To confirm that it's some type of configuration issue I tried it on another webserver and it did work with the exact same files. So what kind of configuration issue should I look into? Or what obvious answer did I miss? Thanks in advance.
I apologize in advance if I missed a sticky or other easily searchable post that had my answer. I searched the forums and couldn't find anything.