Page 1 of 1

Session Problems....

Posted: Wed Oct 23, 2002 12:03 pm
by waskelton4
I have a question regarding sessions and hope that maybe someone can give me a hand...

I have a multi page app and I'm using sessions to pass variables around to control the displayed data from a mySql db..

What basically happens is...

i have session variables, three of them, printing out on two different pages using:

Code: Select all

echo '<pre>'; 
print_r($HTTP_SESSION_VARS); 
echo '</pre>';
(php version 4.0.6)

when I comment out my header redirects and print out the $HTTP_SESSION_VARS array instead of redirecting to the third page, they display fine. however.. if i allow the redirect and try to print out the $HTTP_SESSION_VARS array on the third page, one of my session variables that i need is missing and i havne't a clue why..

sessions are started on all three pages



also it may be helpful to note that i have output buffering started using ob_start() on all pages..

i'd appreciate any help...
Thank you

Posted: Wed Oct 23, 2002 1:57 pm
by waskelton4
Also,

If I want to have sessions started on all my pages is it advisable to included the session_start() function in my include('header.php') file? It would make it easier but i wasn't quite sure if it would create any problems for me.

Also, what about session_register()? If i register a var that already has been registered.. what are the results?

Thanks again for the help...
will

Posted: Thu Oct 24, 2002 5:23 am
by Takuma
Use variables than using functions since it's more easier to control. Can you have a look at yor code?