title: Session Variable Resets on Page Refresh
body: <p>I wish to Update My Session Variable but it's resets everytime I refresh the page, What should I do?</p>
  
  <pre><code>&lt;?php
  
  session_start();  
  include_once 'connect.php';
  
  $currID = $_SESSION['user_id'][0];  
  $sfName = $_SESSION['user_id'][1];  
  $smName = $_SESSION['user_id'][2];  
  $slName = $_SESSION['user_id'][3];  
  
  $fullName = $_POST['fullName'];  
  list($vfName, $vmName, $lvName) = explode('|', $fullName);
  
  $qEditName = "UPDATE userzavier SET fname='$vfName', mdname='$vmName', lname='$lvName' where ID='$currID'";  
  if (mysqli_query($con, $qEditName)) {  
      $sfName = $vfName;  
      $smName = $vmName;  
      $slName = $lvName;  
      echo $sfName . ' ' . $smName . ' ' . $slName;  
     } else {  
      echo "Error updating record: " . mysqli_error($con);  
     }  
     mysqli_close($con);  
  
  ?&gt;
  </code></pre>