Strange session

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
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Strange session

Post by thatsme »

I have a login page and an inner page. The session is set when user log in and it is used in the inner page. This is correctly happening but, if i keep the page without doing anything (i think after session value gets lost) and if some other user logs in in another system then if i refresh my inner page, i am getting his id instead of mine. I am using PHP.

For setting the session when loging in i am using

session_start();
$_SESSION['member_id'];



in the inner page, i am using

session_start();
$id = $_SESSION['member_id'];

Thanks
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Strange session

Post by RobertGonzalez »

The first part of your code does nothing with the session var. What are you attempting to do?
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Re: Strange session

Post by thatsme »

session_start();
$_SESSION['member_id'] = $memberID;

the $memberID value is in database.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Strange session

Post by RobertGonzalez »

I think you are going to have to show more code. What you have posted so far is not nearly enough for us to figure out what is happening in that script.
Post Reply