By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

Losing one session vatiable, rest are still intact

P: n/a

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.


Mar 14 '06 #1
Share this Question
Share on Google+
2 Replies

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

Mar 15 '06 #2

P: n/a
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.


Mar 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.