|
Posted by K. A. on 05/02/07 06:40
I have two servers at work, 'A' for testing and development, and
server 'B' for production.
On server A, I wrote a PHP test code to login users then direct them
to a personalized page. This is done in 3 steps:
Step 1. Normal http login page.
Step 2. A page called login.php that takes the posted username, stores
it as $_SESSION["username"], and registers it
session_register("username"); user is taken to the personalized page
according to his username and things are fine up to here. (this page
is not displayed, only for redirecting purposes).
Step 3. On the personalized page, I check whether session is started,
then display a welcome message with the username. Session variables
are passed across pages fine.
Next, I did exactly the same steps on server B; at step 2 (above) user
is directed to the correct page. But when I get to step 3, the session
seems to lose or set all its variables to NULL (I checked this using
var_dump($_SESSION)).
The codes on server A and B are identical. I copied the php.ini file
from server A to B (just in case there were differences) and restarted
Apache on server B. But still, session variables are lost in Step 3
although the session is still running.
Any ideas why?
[Back to original message]
|