title: How to check session on page in php?
body: <p>I have created the session on the login page and stored in a variable.
  on the Login page </p>
  
  <pre><code>$_SESSION['user_id'] = $id;
  </code></pre>
  
  <p>Now I want to check session that exists or not? 
         On other pages </p>
  
  <pre><code>  &lt;?php 
    if (session_status() == PHP_SESSION_ACTIVE) {
       echo 'Session is active';
    } 
  </code></pre>