Updating session variables
The symptom was that every page or refresh of the same page generated a new session, and obviously no variables were passed from page to page. scid=kb; EN-US;316112 I'm working on PHP 4.2.3 with Apache 1.3.9 and I've got the problem mentioned above.After logging in I do the simple session_start() $_SESSION['user'] = $_POST['login'] and as for that everythings fine.The target script checks for the session variable and is not able to find it.
Note to self: Perhaps there is a way of sending some data to the browser that will instantiate the session but clear the buffer before sending the 'real' data? I thought it was a coding mistake, but it turns out to be a problem with PHP / IIS. If your symptoms are that the first time it does not work and then hit the back button in the browser and try again and it works, then it is probably this.One thing that I did notice (by accident - I turned on debugging to see what was happening) is that if I send some output to the second page prior to the header() command the session variable was registered.I'm then able to shut down the browser and restart without problems.Well, the default method used to accomplish this is via a cookie set when you initiate the session.Since it appears you are redirecting the user to the member's only page using the Location header on the same page the session is initiated, the PHPSESSID cookie will not be set.