Page 1 of 1

Session variables not saved

Posted: Thu Feb 03, 2005 4:45 pm
by Webbrewer
I am having a problem with session variables. When I run a test program as simple as:
<?php
session_start();
$_SESSION['test'] = "test";
?>
The variable gets saved when the script is run from the command line, but the sess_ file is empty when the same script is run from a browser. This worked before, but something changed to cause it to no longer save to disk. It seems that Apache might be the culprit but I have no idea how to troubleshoot this.

Posted: Thu Feb 03, 2005 7:32 pm
by wyred
Sounds like a permissions problem to me. Running your script from the command line gives you the same permissions as the person who logged into the server.

Running the script from the browser gives you lesser privileges.

Check the folder that stores the sess_ files to see if the permissions have been correctly configured.

Posted: Fri Feb 04, 2005 12:59 pm
by Webbrewer
The folder owner and group is set to apache. I tried giving the folder full global priveleges, but that didn't help...
wyred wrote:Sounds like a permissions problem to me. Running your script from the command line gives you the same permissions as the person who logged into the server.

Running the script from the browser gives you lesser privileges.

Check the folder that stores the sess_ files to see if the permissions have been correctly configured.