title: PHP---if(!session_is_registered deprecated?
body: <p>This if statement has been deprecated</p>
  
  <pre><code>if(!session_is_registered('firstname')){ 
  header("location: index.php"); // &lt;&lt; makes the script send them to any page we set
  } else {
  print "&lt;h2&gt;Could not log you out, sorry the system encountered an error.&lt;/h2&gt;";
  exit();
  }
  </code></pre>
  
  <p>I replaced it with </p>
  
  <pre><code>if ( isset( $_SESSION['firstname'] ) ){
  header("location: index.php"); // &lt;&lt; makes the script send them to any page we set
  } else {
  print "&lt;h2&gt;Could not log you out, sorry the system encountered an error.&lt;/h2&gt;";
  exit();
  </code></pre>
  
  <p>the initial code is attached to my logout.php script. When i then go to the link logout.php, this is displayed "Could not log you out, sorry the system encountered an error."</p>
  
  <p>Is that the right solution since i had no problem with the code</p>