Forum Moderators: coopster

Message Too Old, No Replies

SESSION Variable Problem

How to use a variable throughout a site with a SESSION variable

         

wfernley

5:48 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi everyone,

I am having a problem. Currently on my site I have a user_id that is a SESSION variable. I am using a session variable so that I can call the users information from any page because the variable will always be remembered. I was curious if there is a different way to do this without using a session. Would that be considered a class? I need to have the site remember the users id throughtout the site without using a session.

I'm sure this is a basic question.

Thanks for your help :)

Wes

henry0

5:58 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Out of curiosity/understanding:
Why wouldn't you use a session or a cookie?
What are you trying to achieve?

wfernley

6:01 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well the problem is, I'm trying to incorporate phpbb forums into my site. I need to merge the phpbb users table with my sites users table. So I set it to create a session variable when someone logs in with phpbb so the rest of my site would know a user is logged in. For some reason though after the user logs in it will register the session variable but then when the login script uses a redirect it forgets the session variable. So I was curoius if somewhere it was destroying the session so perhaps if there was another way to do all this without using a session the variable would stay intact.

I hope that makes sense :¦.

Thanks for the reply

henry0

10:14 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you should still try to find the reason causing your session to die
I had once a similar problem, (Not with PHPBB) I am not proud of my solution but it worked
Could you use an “input type “hidden” and use “brute force” To pass back the session value?

Did you check the PHPBB forum I know that this kind of integration is often discussed.

By the way I hope that you installed the very last forum version, again a security problem has been around.
Also FYI if you plan using PHP5, I run a forum on PHP5 and it works fine.

Regards

Henry

wfernley

11:04 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your help Henry0.

I tried searching a bit deeper in the phpbb forums and I found out the problem. It was killing the session. I did figure out how to fix my problem a different way and its a better solution than the plan I had before. It's working great now.

Thanks for your help :)

Wes