title: destroy session after user is deleted but still logged in
body: <p>In the login.php i check if everething is ok and if its i creat the session and redirect the user</p>
  
  <pre><code> $success = $dbh-&gt;prepare("SELECT UserId FROM users WHERE username =:username 
  AND password=:password");
      $success-&gt;bindParam(':username', $username);
      $success-&gt;bindParam(':password', $password);
      $success-&gt;execute();
      $rowSuccess = $success-&gt;fetch();
      $user_id = $rowSuccess['userid'];
  
      $_SESSION['user_id'] = $user_id;
      $_SESSION['loggedIn'] = 1; 
  </code></pre>
  
  <p>So how to destroy the user session when i delete him if he is still logged in</p>