session problem
Posted: Sat Nov 03, 2007 1:55 pm
I have 3 pages. on each page there are text links which links to other page.
home
products
profile
the members login through login page.
login code.
on each page i am getting the session value,
If i login as 'member_a' (assume member exists) and echo the id, i am getting the correct id of member_a. If i do not signout and go to admin and delete member_a and if i refresh member_a's page the first member's id is displayed. How to solve this.
home
products
profile
the members login through login page.
login code.
Code: Select all
$query_member_details=mysql_query("SELECT * FROM members WHERE member_email_id='$member_email_id' AND member_password='$member_password' AND member_flag=1 AND confirm_flag='YES'");
if(mysql_num_rows($query_member_details) > 0)
{
$fetch_member_details=mysql_fetch_array($query_member_details);
$member_id=$fetch_member_details['member_id'];
session_start();
$_SESSION['member_id']=$member_id;
header("Location:".SITE_URL);
}
else
{
$message='Invalid Login';
}on each page i am getting the session value,
Code: Select all
<?php
require_once('general/require_once.php');
session_start();
$member_id=$_SESSION['member_id'];
//rest of the codeIf i login as 'member_a' (assume member exists) and echo the id, i am getting the correct id of member_a. If i do not signout and go to admin and delete member_a and if i refresh member_a's page the first member's id is displayed. How to solve this.