Session problem between pages

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
lauryn1298
Forum Newbie
Posts: 2
Joined: Mon Feb 08, 2010 6:21 am

Session problem between pages

Post by lauryn1298 »

Hello,

I have a problem passing the values of the form variables between pages when I want to save them in session.
I'm using sessions for saving another values that don't come from the form, and all of them are saved in the session correctly. For example I'm saving the user and the profile once the user is logged, and I pass this value through all the pages without any problem. But now I have to save some values of a form, just in case the user wants to come back and see the values that previously had inserted.
When I print the session in the page where I'm reading the form variables, all of them are set correctly, but when I go back they are empty, but the ones that I had previously are saved correctly.
I was looking for a solution in different forums, I change the name of the variable of the session (at the beginning the name of the session variable and the variable form were the same, and this was giving me problems). I did everything I can think, but the problem is still there.
I'm not sure if it's a problem with the global variables.... In my php.ini are off, and I wouldn't like to change this.

Many thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Session problem between pages

Post by Christopher »

Are you sure you are calling session_start() before every use of $_SESSION?
(#10850)
PHPchong
Forum Newbie
Posts: 3
Joined: Sat Mar 20, 2010 11:52 pm

Re: Session problem between pages

Post by PHPchong »

Hey Lauryn1298, I think I'm running into the exact same issue as you are which I posted about here not too long ago:

viewtopic.php?f=1&t=114448

Unfortunately I haven't made much more progress on this since my post and i'm waiting to hear back from my hosting provider to see if they've had any luck troubleshooting. Have you been able to figure this out?
Post Reply