Help: sessions

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
ruth
Forum Newbie
Posts: 19
Joined: Wed Aug 07, 2002 9:24 pm
Location: Melbourne, Australia

Help: sessions

Post by ruth »

Hi Everyone,
I have a php database application. User's access information is stored in a session variable eg. $_SESSION["user"]. The session variables are set in an authenication class.

Every thing worked fine previously. However, we just upgraded PHP from Version 4.2.1 to 4.3.1 in order to include GD library. Now, all session varibales disappeared from the following pages. I have spent a whole day on this, and looked at php.net. But still can not find an anwser :cry: . No one can access to the application now. I am hoping some one in this forum can help me out please.

(By the way, I did a simple test to set a session without using the class, it works.)

Thank you very much in advance.

Ruth
ruth
Forum Newbie
Posts: 19
Joined: Wed Aug 07, 2002 9:24 pm
Location: Melbourne, Australia

Post by ruth »

I fixed the problem by adding "session_start()" at start of the function within the authentication class (previously, session_start() was called at start of the file). I can not explain why, but it works.

Ruth
Post Reply