Updating session variables

Rated 3.99/5 based on 548 customer reviews

To make sure cookie is enabled _always_, user must check it first. author=yohgaki Use session helper html or other people post without Java Script version.Hi I've also had a similar problem of session variables not being passed following a call to header(). The following worked for me, by placing a session_write_close() before the call to header, followed by and exit(): session_write_close(); header("Location: $str Page"); exit(); I hope this will be of use to some.

If this is the case then how comes that I don't have this problem when I use PHP Version 4.0.1 with Apache? Some browser does not set cookie for initial request.

However, if I reboot my machine, I must send the debug output again.

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.

But when changing from test.php, where above code is stored, into another page during the same session the variable appears to be empty!

In short, although the variable is being registered fine it's not visible in other scripts, what is an obvious denial of an idea of session variables. I've been fighting this one for over three days in many ways but nothing seems to have an effect.

Leave a Reply