Losing one session vatiable, rest are still intact

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am setting session variables on a page then doing a header/location
redirect to a second page however I am losing one of my session
variables.  Not all of them, just one.

Here are some details/comments:

I am doing a session_start() on ALL of my pages, right at the top of
each page

I have tried session_write_close() before doing the redirect

A print_r of $_SESSION on the first page shows all of the variables
intact before the redirect is attempted

There is nothing in the code or in an included file that
unsets/destroys/overwrites the session variable.

The code that sets the variable is not within an output buffer

PHP version 4.3.1, Apache version running on Windows 2000

Surely this shouldn't happen?  If I was losing the entire session that
would kind of be understandable but losing ONE variable out of about 10
or 11 is very strange.

Has anyone experienced this before or can anyone offer an explanation?
Let me know if you need any further details.

Thanks for any advice offered.


Re: Losing one session vatiable, rest are still intact

It would be useful to know what exactly this variable is holding. Is it
a reference?

Re: Losing one session vatiable, rest are still intact

It's okay, my colleague found the problem.  There in fact WAS a session
command in one of their included files which was causing the problem.
I think it was an old session_register() that was causing the problem.


Site Timeline