Session Problems....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

Session Problems....

Post 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
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

Post 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
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Use variables than using functions since it's more easier to control. Can you have a look at yor code?
Post Reply