I'm building a site and using sessions, I've done this a million times before and it worked fine.
What's happening is I'm using a single page to handle 3 submits, posting back to itself. On the first submit, a session is registered (session_register['user']; $_SESSION['user']=$user
.
I'm checking the 'user' variable in two places: at the beginning of the page and right after the code that sets the session. The beginning displays nothing, but the second shows the session variable correctly.
I've narrowed it down to two things:
1. If a page registers a session variable and POSTS back to itself, is the session destroyed (highly doubt this but just want my sanity confirmed)?
2. If there is html & header information on the page previous to the session_start(), does it mess up the sessions?
What's happening is I'm using a single page to handle 3 submits, posting back to itself. On the first submit, a session is registered (session_register['user']; $_SESSION['user']=$user
I'm checking the 'user' variable in two places: at the beginning of the page and right after the code that sets the session. The beginning displays nothing, but the second shows the session variable correctly.
I've narrowed it down to two things:
1. If a page registers a session variable and POSTS back to itself, is the session destroyed (highly doubt this but just want my sanity confirmed)?
2. If there is html & header information on the page previous to the session_start(), does it mess up the sessions?