title: Get information from database without signing out and back in
body: <p>I want to get the updated information from the database when the site is refreshed instead of having to log out and back in. </p>
  
  <p>I get the information form user.php when they login, then they get redirected to memberpage.php. When they refresh memberpage.php, if anything is changed on the database it will be changed on memberpage aswell. So if they logged in with isBanned_reason = 0 and then i change it to 1 on the database, i want that to it to change on the memberpage aswell.</p>
  
  <p>Heres my code : 
  user.php</p>
  
  <pre><code>&lt;?php
  include('password.php');
  class User extends Password{
  
      private $_db;
  
      function __construct($db){
          parent::__construct();
  
          $this-&gt;_db = $db;
      }
  
      private function get_user_hash($username){
  
          try {
              $stmt = $this-&gt;_db-&gt;prepare('SELECT password, username, memberID, isBanned_reason, Rank FROM members WHERE username = :username AND active="Yes" ');
              $stmt-&gt;execute(array('username' =&gt; $username));
  
              return $stmt-&gt;fetch();
  
          } catch(PDOException $e) {
              echo '&lt;p class="bg-danger"&gt;'.$e-&gt;getMessage().'&lt;/p&gt;';
          }
      }
  
      public function login($username,$password){
  
          $row = $this-&gt;get_user_hash($username);
  
          if($this-&gt;password_verify($password,$row['password']) == 1){
  
            $_SESSION['loggedin'] = true;
            $_SESSION['username'] = $row['username'];
            $_SESSION['memberID'] = $row['memberID'];
            $_SESSION['Rank'] = $row['Rank'];
            $_SESSION['isBanned_reason'] = $row['isBanned_reason'];
  
  
              return true;
          }
      }
  
      public function logout(){
          session_destroy();
      }
  
      public function is_logged_in(){
          if(isset($_SESSION['loggedin']) &amp;&amp; $_SESSION['loggedin'] == true){
               $_SESSION['Rank'];
               $_SESSION['isBanned_reason'];
  
                          return true;
          }
      }
  
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>memberpage.php</p>
  
  <pre><code>&lt;?php require('includes/config.php'); 
  
  
  
  //if not logged in redirect to login page
  if(!$user-&gt;is_logged_in()){ header('Location: login.php'); } 
  
  
  
  //define page title
  $title = 'Members Page';
  
  //include header template
  
  ?&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="style/Stylememberpage.css"&gt;
  
  
  
  
  
  
  &lt;?php if ($_SESSION['isBanned_reason'] == 0) {?&gt;
  &lt;body&gt;
     &lt;center&gt;
  &lt;p&gt;
  &lt;h1 id="Caption1"&gt;Secret website title&lt;/h1&gt;
  &lt;h2 id="Caption2"&gt;You are logged in as a staff member&lt;/h2&gt;
  &lt;ul id="menu"&gt;
  &lt;li id="items"&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li id="items"&gt;&lt;a href="registrer.php"&gt;Staff Site&lt;/a&gt;&lt;/li&gt;
  &lt;li id="items"&gt;&lt;a href="Leaderboards.html"&gt;Games&lt;/a&gt;&lt;/l1&gt;
  &lt;li id="items"&gt;&lt;a href="Contact.html"&gt;Leaderboard&lt;/a&gt;&lt;/li&gt;
  &lt;li id="items"&gt;&lt;a href="logout.php"&gt;Log out&lt;/a&gt;&lt;/li&gt;
  &lt;/body&gt;
  &lt;/ul&gt;
  
  
    &lt;/p&gt;
  &lt;/center&gt;
  
  &lt;?php
  }
  ?&gt;
  
  
  
  
  
  
  
  
  
  
  
  &lt;?php if ($_SESSION['isBanned_reason'] == 1) {?&gt;
  &lt;body&gt;
     &lt;center&gt;
  &lt;p&gt;
  &lt;h1 id="Banned1"&gt;Your account has been locked.&lt;/h1&gt;
  &lt;h2 id="Banned2"&gt;You are banned for until: 12.12.2020 reason : scamming/exploit.&lt;/h2&gt;
  &lt;ul id="menu"&gt;
  &lt;li id="items"&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li id="items"&gt;&lt;a href="registrer.php"&gt;Staff Site&lt;/a&gt;&lt;/li&gt;
  &lt;li id="items"&gt;&lt;a href="Leaderboards.html"&gt;Games&lt;/a&gt;&lt;/l1&gt;
  &lt;li id="items"&gt;&lt;a href="Contact.html"&gt;Leaderboard&lt;/a&gt;&lt;/li&gt;
  &lt;li id="items"&gt;&lt;a href="logout.php"&gt;Log out&lt;/a&gt;&lt;/li&gt;
  &lt;/body&gt;
  &lt;/ul&gt;
  
  
    &lt;/p&gt;
  &lt;/center&gt;
  
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>And, if its possible. When i change isBanned_reason on my database, is there any way to "apply" that without the user having to refresh the page? Because i want them to be banned immediately when its changed. How could i do that?</p>