I am trying to debug an error of Notice: Undefined index
at line 5,
$res=$conn->query('SELECT _name, _PETeacher FROM classes;');
$_SESSION['pe_cla']=array();
while($row=$res->fetch_assoc())
{
if ($row['_PETeacher']!=null && $row['_name']!=null && $row['_PETeacher'] == $_SESSION['Reg'])
{
$_SESSION['pe_cla'][] = $row['_name'];
}
}
The same error message also occationally appear at the following line:
<?php if($_SESSION['Privileges'][6]==0){echo 'd-none';}?> href="class_promo.php">
It seems that it has something to do with the $_SESSION['Reg']
, maybe it is the login session.
I am thinking that maybe the "session" get reset or expired. How to extend the life of a session?
Can a same user login from multiple device?