Quote:
quote:Originally posted by socoolbrewster
My question was, have I overlooked a configuration setting on the inital set-up of PHP to cause this problem? as I have uploaded the two below examples onto an actually live server and they work fine. I just cannot get the same result when run on a local server on my PC.
|
Well that's what the other two threads are about, did you read my replies explicitly, nevermind the original topics.
On Windows the session data directory must be created and given write permissions explicitly or the session data is lost (hence an overlooked configuration setting), refer to topic posted at:
http://p2p.wrox.com/topic.asp?TOPIC_ID=12148. This thread also refers to the php.ini configuration file, where all pre-set session configurations are stored.
What is the error_reporting directive of php.ini set to (to develop it should be E_ALL), if session_start() fails to create a session or send out a cookie it'll complain in the form of E_WARNING level errors. Are you seeing any error output?
Also look at these two and be sure that your errors aren't going to a log:
display_errors = On
log_errors = Off
Quote:
quote:Originally posted by socoolbrewster
My question is, could there be a setting in the PHP.ini file that I need to enable / change? I have also disabled Norton Systems Works (Firewall etc..) and that doesn't seem to work!
|
The firewall doesn't have anything to do with PHP sessions, since all sessions are kept on the server and anything output from PHP goes over port 80, unless you're trying to access the server on another port, then there might be a problem there.
Quote:
quote:Originally posted by socoolbrewster
My understanding of sessions it that on first call of session_start() the ID created remains active and does'nt change when the browser in refreshed, unless the browser is closed and restarted. And that as long as COOKIES are enabled on the browser I shouldn't have the problem I currently face. Does that explain things better? as I am confused now?
|
OK, session_start creates a session_id if one isn't currently active, it also imports all variables currently in that user's session data file into the current script (if any exist), these go into the $_SESSION superglobal. Then lastly, it outputs a cookie containing the session_id to the user's browser.
Read up on sessions:
http://www.php.net/session
hth,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::