Sir I am using these codes on login.php
session_start();
$query="select * from w_log where email ='".$muser."' and pass='".$mypass."'";
$result=sqlsrv_query($con,$query)or die ("Error". sqlsrv_errors($con)) ;
while($res = sqlsrv_fetch_array($result)) {
$_SESSION['id']=($res['id']);
$_SESSION['sno']=($res['usno']);
$_SESSION['user']=($res['name']);
$_SESSION['status']=($res['status']);
}
//header("location:../index.php");
//exit();
echo $_SESSION['status'];
$_SESSION['status'] is equal to GENERAL
But when I call this variable at the top of index.php
session_start();
echo $_SESSION['status'];
It says: ADMIN
Why session $_SESSION['status'] changes its value automatically?
Please help