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