title: Success to register but fail to save the session
body: <p>I want to save session after user registers their account. It is successful before this, but when I try again today, it's failing.</p>
  
  <pre><code>$email = $_POST['email'];
  $password   = $_POST['password'];
  
  $sql = "select * from customer where Email = '".$email."'";
  $rs = mysqli_query($db,$sql);
  $numRows = mysqli_num_rows($rs);
  
  if($numRows  &gt; 0 ){
      echo "Email has been used";
  }
  else {
      $options = array("cost"=&gt;4);
      $hashPassword = password_hash($password,PASSWORD_BCRYPT,$options);
      $sql = "insert into customer (Email, Password) value('".$email."', '".$hashPassword."')";
      $result = mysqli_query($db, $sql);
      if($result) {
          $_SESSION["Email"] = $result["Email"];
          $_SESSION["Name"] = $result["Name"];
          header('Location: ../index.php');
      }
      else {
          echo "Cant";
      }
  }`
  </code></pre>
  
  <p>How can solve this issue?</p>