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
Strange session
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Strange session
The first part of your code does nothing with the session var. What are you attempting to do?
Re: Strange session
session_start();
$_SESSION['member_id'] = $memberID;
the $memberID value is in database.
$_SESSION['member_id'] = $memberID;
the $memberID value is in database.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Strange session
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.